[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: pass trx_lchan_state to lchan handlers

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: pass trx_lchan_state to lchan handlers
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6760
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I47a40542b03ab31da12b0abb1c263c83662ff018
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: fix possible NULL deference

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: fix possible NULL deference
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6754
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1d0b870c389802b51c709d089b80ac3fb3565fa8
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: drop a meaningless FIXME label

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: drop a meaningless FIXME label
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6757
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: If5497f4fdce22e986f46725cc1575a1e809ccdab
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: whitespace fix

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: whitespace fix
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6767
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Iad2be36777e4a2454e181c856c7902574a4ab20c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: include DL frame info in L1CTL_DATA_CONF

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: include DL frame info in L1CTL_DATA_CONF
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6776
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia8dfaed924fd84395ba9ae539164eaa94f52d30b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: separate DataInterface from burst_gen.py

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: separate DataInterface from burst_gen.py
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6766
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I325cf2ae59ef8834c2ddfb67206eede44d1e0acf
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: handle L1CTL_TCH_MODE_REQ

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: handle L1CTL_TCH_MODE_REQ
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6777
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib2332e1610fa873755cdfa745153c7b7d4a72a62
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: send stored tx_power to transceiver

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: send stored tx_power to transceiver
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6771
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I8ba70bbda6c8c9249f8eb4294aeb41ab8769a19a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: add options to specify fn, tn and pwr

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: add options to specify fn, tn and pwr
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6765
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ifd4f4864707596a69fece11218a4800b98551c31
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: share common code for lchan handlers

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: share common code for lchan handlers
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6763
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I34c3de351362ebd9a070f49bb78d7bd976784b04
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: make l1ctl_tx_data_ind flexible

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: make l1ctl_tx_data_ind flexible
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6762
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I945c10c317155917b6e6ce9d663d9cb46f2e085c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: clean up some includes

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: clean up some includes
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6764
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I47e3b953b80f4f822d563579d15498181009ca80
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: separate logging of L1 Control and L1 Data

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: separate logging of L1 Control and L1 Data
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6769
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Id830c8bf913f7a8ddc87c47f70a337ee4623abd8
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: share primitive management code

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: share primitive management code
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6774
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I8169a1ef4ef54d91b50f3e213e4842f54af8b499
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: do nothing if CCCH mode matches

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: do nothing if CCCH mode matches
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6768
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib8a511e4edd7210b1806f47e83f316be00a8cbb1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: fix wrong log level

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: fix wrong log level
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6770
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I0ac65d94b0ae3dd370675318a26a65d11c49cbbe
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/trx_if.c: fix wrong logging category

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/trx_if.c: fix wrong logging category
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6780
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I0df0205e160fd9ea5811852077db7c49cddc7e8a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: use LOGP instead of fprintf

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: use LOGP instead of fprintf
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6781
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I86dda5b3d746c7802442e4226578a06c04941721
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: separate logging of data messages

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: separate logging of data messages
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6783
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I3a33687a688db2a183b546425f71c7a0a7030594
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/trx_if.c: get rid of useless commands

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/trx_if.c: get rid of useless commands
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6792
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I3e61b4b48193004cdcb241cefabb44c12db93120
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: fix prim queue flushing function

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: fix prim queue flushing function
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6779
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia84b57350a5c2eee0afebc65f62e30eaddb141d4
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: use new libosmocoding API for RACH

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: use new libosmocoding API for RACH
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6797
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1955fe46eebd173d6eddd1d47ee9f7318b9b4e2d
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: don't sent clock indications until POWERON

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: don't sent clock indications until POWERON
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I86ccc9d26fc54e6511f74f858afdaebb2b284c19
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_gen.py: remove unused import

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_gen.py: remove unused import
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6787
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I407877e2025663f706d1a2f93e6228770bfc253c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/trx_if.c: separate logging of data messages

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/trx_if.c: separate logging of data messages
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6782
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I74ebe0441aeb41c324eafb6b586b2edd9ef4fd1a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/ctrl_cmd.py: add help and basic command line options

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/ctrl_cmd.py: add help and basic command line options
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6785
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic6eeb69d9a1fc151eab2e63f3708e3d70e2e558b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6791
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic9b232c8561609d42dac10e6249a3e1c58c4edc1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: correct brief descriptions of files

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: correct brief descriptions of files
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6789
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie76fee4a567681a5380be90e5744621c2aa3e5f0
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: forward Timing Advance value to transceiver

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: forward Timing Advance value to transceiver
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6793
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia8c0848827ab2b4cd7cf1efe128b28d5c06ec84e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: process frames in advance

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: process frames in advance
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6790
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic258a169f3554f931d6277e18ca060d029b77f32
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/README: correct the branch name

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/README: correct the branch name
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6786
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I9d65580570d9bced65a7bcc95ca073ecc3e130e5
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/clck_gen.py: reset the clck_src when calling stop()

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/clck_gen.py: reset the clck_src when calling stop()
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6795
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1043f71a2cbe856a0cb605db8a7feab9defa6afd
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: implement a new tool for burst sending

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: implement a new tool for burst sending
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6788
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I2c542583252d31daac466e6c7837317fda8a7020
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: fix: use valid names for FSM instances

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: fix: use valid names for FSM instances
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6784
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Icaaac3f51bdcfe4f7723060179b8730c3a06529b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/clck_gen.py: send the first indication immediately

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/clck_gen.py: send the first indication immediately
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6794
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I0132dd939b02db357d248abf65c9116d6a1802d0
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: use linuxlist API for lchan management

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: use linuxlist API for lchan management
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6817
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I5a78582c77ed1ab33817d240e065dc4cd4708199
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: inform L2&3 about decoding errors

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: inform L2&3 about decoding errors
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6804
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I31011d8f3ca8b9a12474cd0bc653faed18391033
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_gen.py: don't store RandBurstGen

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_gen.py: don't store RandBurstGen
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6828
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I5bf5846c2b8fa1211cf5150545b9d001c17fa0eb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: separate primitive management code

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: separate primitive management code
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6807
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ifec8c9e4f2c95c72b00772688bcb5dc9c11d6de7
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: prioritize FACCH correctly

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: prioritize FACCH correctly
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6809
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I925cca77bfaa255dd095bc882c901d41c9bc4633
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/l1ctl.c: handle L1CTL_TRAFFIC_REQ

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/l1ctl.c: handle L1CTL_TRAFFIC_REQ
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6802
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ibdf2d4f6aa464250a4c6951af86c06eb3fd3b98b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_gen.py: also handle RSSI and ToA values

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_gen.py: also handle RSSI and ToA values
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I7c9441c1154c925dcb5c743e39445495233c123e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: L1CTL/L1CTL_CRYPTO_REQ: add key length and channel info

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: L1CTL/L1CTL_CRYPTO_REQ: add key length and channel info
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6810
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1813a188e755141241273479b17896415abcc3f1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: share chan / prim identification helpers

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: share chan / prim identification helpers
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6814
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic8af9d7c72fdb124caef82e35170f92b84e16eb9
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: clean up the trx_lchan_state

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: clean up the trx_lchan_state
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie753a7e3e7fa2b433d8319b3a05b85b8583d7be2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: use TCH frame length defs from libosmocodec

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: use TCH frame length defs from libosmocodec
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I6439d3cadd2dc1fa8fe401eb61c977a12ec844f2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: BUGFIX: distinguish between SACCH and FACCH

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: BUGFIX: distinguish between SACCH and FACCH
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6806
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia7090384f3ff74c9d94997265135acbceffa0ffe
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: add initial TCH/F channel support

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: add initial TCH/F channel support
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6803
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: If6b0eaede2b484484d2a824e7219ff04483266a1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: common/l1ctl.c move TCH bit-ordering to the firmware

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: common/l1ctl.c move TCH bit-ordering to the firmware
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6801
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I235a9f535c39d8e57f5d2c6566daeaf883aeef9e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6800
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: implement classes for DATA messages

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: implement classes for DATA messages
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6823
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Id1c72f0b18fb128acc74d0cd899fb7aab7bd8790
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon/scheduler: drop meaningless memset call

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon/scheduler: drop meaningless memset call
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6799
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I18a938cef350632673cfc820beed5e42f40d89e7
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: move prim management outside lchan handlers

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: move prim management outside lchan handlers
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6808
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I29503ece51903784bc53541015285234471c8d15
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: drop meaningless TODO comment

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: drop meaningless TODO comment
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6818
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I84979712e2a1b849acaee53d5cd50de4e1e357c2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: deactivate lchans when resetting / deletin...

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: deactivate lchans when resetting / deleting TS
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6816
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I8c34c793df87bd8c79b7bf1f05b949faf10520e8
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: implement A5/X ciphering support

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: implement A5/X ciphering support
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6812
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib53418d8c0f394fdece09cf5cc240887cb0bb5af
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: reset lchan state after deactivation

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: reset lchan state after deactivation
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6815
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I91e736a97cb05b167614cb488a00d847a9a859e0
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: preprocess UL bursts before sending

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: preprocess UL bursts before sending
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6811
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia6eead5d4f51d7c0bf277b9d5ebb0a74676df567
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon/scheduler: FIX: return NULL from TCH dequeue function

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon/scheduler: FIX: return NULL from TCH dequeue function
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6813
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Iae37057d35883c09a76f0612e52c2d14d9ff91cb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: implement a new tool for TRX protocol sniffing

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: implement a new tool for TRX protocol sniffing
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6821
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I6e65e1d657574cc3e67bc7cdb1c01ef6bf08ecde
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: share and use common GSM constants

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: share and use common GSM constants
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6822
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Id6cdfbc6e8688755a0df7e44daa512c9afa7dad2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_send.py: indicate actual burst source

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_send.py: indicate actual burst source
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6820
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I7e45996f4a7a2aacc962ff9b65107c6b04e7bf68
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_send.py: handle both GSM and EDGE bursts

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_send.py: handle both GSM and EDGE bursts
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6832
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Iab13dd06f175556137c5e25d2cbddb9bea403b09
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: use DATAMSG classes for DATA messages

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: use DATAMSG classes for DATA messages
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6829
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ibc99126dc05d873c1ba538a5f4e74866de563f56
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/data_msg.py: implement header description

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/data_msg.py: implement header description
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6826
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Iafe63e39ad68f4ff373ae098424d76ca9f83c8fc
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/data_msg.py: handle bursts properly

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/data_msg.py: handle bursts properly
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6825
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I909b7a4dc70e8c632987bde07f00281a6595c4cb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_send.py: also handle RSSI and ToA values

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_send.py: also handle RSSI and ToA values
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6831
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Idb9a5ae4a8980a320f6e620c66add7c7393d3ecb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_gen.py: check argv separately

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_gen.py: check argv separately
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6827
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I35b5475d3b6df6dc92a1981c693afb63df866c87
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/data_msg.py: implement header randomization

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/data_msg.py: implement header randomization
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6824
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I724e267382ff32ef1f964b1ee6cbe99069139867
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/trx_sniff.py: use DATADumpFile for capture writing

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/trx_sniff.py: use DATADumpFile for capture writing
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6834
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I7c30bcea294ce7270bf905ae5420a06dbc2e46f1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx: implement classes for DATA capture menagement

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx: implement classes for DATA capture menagement
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6833
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1b31183bd7bcca94de089847ee0b2f4ec88a7f1d
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: initial release of L1CTL interface

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: initial release of L1CTL interface
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6682
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I58d069bcc7742b42c0bf95e52063933bf2c352ff
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] osmocom-bb[master]: host/trxcon: introduce a new 'trxcon' application

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: introduce a new 'trxcon' application
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6681
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie3c17f19aad9c26f3c49966a7c96b65911f62369
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] osmocom-bb[master]: fake_trx/burst_send.py: implement DATA capture support

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_send.py: implement DATA capture support
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6836
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I626662bd1897c874421ab5178970ec19325f8a47
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/burst_gen.py: add burst capture support

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/burst_gen.py: add burst capture support
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6835
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I074ff7dbc4d6beecdecce20de9dade5939e707f2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: trxcon: change default port number to 5703 to avoid clashes ...

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: trxcon: change default port number to 5703 to avoid clashes 
with osmo-bts-trx
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6838
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I66b5f25aaba3b836448ed29839c39869b5622bed
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: fake_trx/data_dump.py: use 2 bytes to store message length

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: fake_trx/data_dump.py: use 2 bytes to store message length
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6837
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I5a69d5cf2914fe56b2f9acca6054c9470627f91e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[ABANDON] osmocom-bb[master]: host/trxcon: initial release of transceiver interface

2018-02-22 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: host/trxcon: initial release of transceiver interface
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/6683
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I96fa3ada05d010f31af419a4950fd8ae2b62ef34
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmocom-bb[master]: fake_trx/burst_send.py: indicate actual burst source

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6820

fake_trx/burst_send.py: indicate actual burst source

Change-Id: I7e45996f4a7a2aacc962ff9b65107c6b04e7bf68
---
M src/target/fake_trx/burst_send.py
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/20/6820/1

diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index bed6b44..a8519ed 100755
--- a/src/target/fake_trx/burst_send.py
+++ b/src/target/fake_trx/burst_send.py
@@ -67,8 +67,10 @@
 
# Open the burst source (file or stdin)
if self.burst_src is not None:
+   print("[i] Reading bursts from file '%s'..." % 
self.burst_src)
src = open(self.burst_src, "r")
else:
+   print("[i] Reading bursts from stdin...")
src = sys.stdin
 
# Generate a random frame number or use provided one

-- 
To view, visit https://gerrit.osmocom.org/6820
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e45996f4a7a2aacc962ff9b65107c6b04e7bf68
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: trxcon/scheduler: use TCH frame length defs from libosmocodec

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6819

trxcon/scheduler: use TCH frame length defs from libosmocodec

Change-Id: I6439d3cadd2dc1fa8fe401eb61c977a12ec844f2
---
M src/host/trxcon/sched_lchan_common.c
M src/host/trxcon/sched_trx.h
2 files changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/19/6819/1

diff --git a/src/host/trxcon/sched_lchan_common.c 
b/src/host/trxcon/sched_lchan_common.c
index 9eccc3e..52c9a21 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -33,6 +33,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 7ee1d47..b01624c 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -23,11 +23,6 @@
 
 #define MAX_A5_KEY_LEN (128 / 8)
 
-/* TS 101318 Chapter 5.1: 260 bits + 4bit sig */
-#define GSM_FR_BYTES   33
-/* TS 101318 Chapter 5.3: 244 bits + 4bit sig */
-#define GSM_EFR_BYTES  31
-
 /* Forward declaration to avoid mutual include */
 struct trx_lchan_state;
 struct trx_instance;

-- 
To view, visit https://gerrit.osmocom.org/6819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6439d3cadd2dc1fa8fe401eb61c977a12ec844f2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/trx_sniff.py: use DATADumpFile for capture writing

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6834

fake_trx/trx_sniff.py: use DATADumpFile for capture writing

Since we have a separate class for DATA capture management now,
no need to implement the wheel - let's just use it!

Change-Id: I7c30bcea294ce7270bf905ae5420a06dbc2e46f1
---
M src/target/fake_trx/trx_sniff.py
1 file changed, 8 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/34/6834/1

diff --git a/src/target/fake_trx/trx_sniff.py b/src/target/fake_trx/trx_sniff.py
index 91c2c4a..f59e609 100755
--- a/src/target/fake_trx/trx_sniff.py
+++ b/src/target/fake_trx/trx_sniff.py
@@ -27,6 +27,7 @@
 
 import scapy.all
 
+from data_dump import DATADumpFile
 from data_msg import *
 
 COPYRIGHT = \
@@ -69,9 +70,9 @@
print(COPYRIGHT)
self.parse_argv()
 
-   # Open requested file for writing
+   # Open requested capture file
if self.output_file is not None:
-   self.output_file = open(self.output_file, "ab")
+   self.ddf = DATADumpFile(self.output_file)
 
def run(self):
# Compose a packet filter
@@ -126,10 +127,8 @@
print("[i] %s burst: %s" \
% ("L1 -> TRX" if l12trx else "TRX -> L1", 
msg.desc_hdr()))
 
-   # Poke burst handler
-   rc = self.burst_handle(l12trx, msg_raw, msg)
-   if rc is False:
-   self.shutdown()
+   # Poke message handler
+   self.msg_handle(msg)
 
# Poke burst counter
rc = self.burst_count(msg.fn, msg.tn)
@@ -158,22 +157,13 @@
# Burst passed ;)
return True
 
-   def burst_handle(self, l12trx, msg_raw, msg):
+   def msg_handle(self, msg):
if self.print_bursts:
print(msg.burst)
 
+   # Append a new message to the capture
if self.output_file is not None:
-   # TLV: tag defines burst direction (one byte, BE)
-   self.output_file.write('\x01' if l12trx else '\x02')
-
-   # TLV: length of value (one byte, BE)
-   length = len(msg_raw)
-   self.output_file.write(chr(length))
-
-   # TLV: raw value
-   self.output_file.write(msg_raw)
-
-   return True
+   self.ddf.append_msg(msg)
 
def burst_count(self, fn, tn):
# Update frame counter
@@ -207,10 +197,6 @@
# Print statistics
print("[i] %u bursts handled, %u dropped" \
% (self.cnt_burst_num, self.cnt_burst_dropped_num))
-
-   # Close output file if opened
-   if self.output_file is not None:
-   self.output_file.close()
 
# Exit
sys.exit(0)

-- 
To view, visit https://gerrit.osmocom.org/6834
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c30bcea294ce7270bf905ae5420a06dbc2e46f1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx: share and use common GSM constants

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6822

fake_trx: share and use common GSM constants

Previously there were multiple definitions of some common GSM
constants in different modules. Let's share them.

Change-Id: Id6cdfbc6e8688755a0df7e44daa512c9afa7dad2
---
M src/target/fake_trx/burst_gen.py
M src/target/fake_trx/burst_send.py
M src/target/fake_trx/clck_gen.py
M src/target/fake_trx/data_if.py
A src/target/fake_trx/gsm_shared.py
M src/target/fake_trx/rand_burst_gen.py
6 files changed, 46 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/22/6822/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index 087fe79..68ba0ec 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -29,6 +29,7 @@
 
 from rand_burst_gen import RandBurstGen
 from data_if import DATAInterface
+from gsm_shared import *
 
 COPYRIGHT = \
"Copyright (C) 2017 by Vadim Yanitskiy \n" \
@@ -73,7 +74,7 @@
 
# Generate a random frame number or use provided one
if self.fn is None:
-   fn = random.randint(0, DATAInterface.GSM_HYPERFRAME)
+   fn = random.randint(0, GSM_HYPERFRAME)
else:
fn = self.fn
 
@@ -106,7 +107,7 @@
self.tn, fn, self.pwr)
 
# Increase frame number (for count > 1)
-   fn = (fn + 1) % DATAInterface.GSM_HYPERFRAME
+   fn = (fn + 1) % GSM_HYPERFRAME
 
self.shutdown()
 
diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index a8519ed..ee8e51a 100755
--- a/src/target/fake_trx/burst_send.py
+++ b/src/target/fake_trx/burst_send.py
@@ -27,6 +27,7 @@
 import sys
 
 from data_if import DATAInterface
+from gsm_shared import *
 
 COPYRIGHT = \
"Copyright (C) 2017 by Vadim Yanitskiy \n" \
@@ -75,7 +76,7 @@
 
# Generate a random frame number or use provided one
if self.fn is None:
-   fn = random.randint(0, DATAInterface.GSM_HYPERFRAME)
+   fn = random.randint(0, GSM_HYPERFRAME)
else:
fn = self.fn
 
@@ -109,7 +110,7 @@
self.tn, fn, self.pwr)
 
# Increase frame number (for count > 1)
-   fn = (fn + 1) % DATAInterface.GSM_HYPERFRAME
+   fn = (fn + 1) % GSM_HYPERFRAME
 
# Finish
self.shutdown()
diff --git a/src/target/fake_trx/clck_gen.py b/src/target/fake_trx/clck_gen.py
index 088155b..484ecde 100755
--- a/src/target/fake_trx/clck_gen.py
+++ b/src/target/fake_trx/clck_gen.py
@@ -28,6 +28,7 @@
 
 from threading import Timer
 from udp_link import UDPLink
+from gsm_shared import *
 
 COPYRIGHT = \
"Copyright (C) 2017 by Vadim Yanitskiy \n" \
@@ -39,7 +40,6 @@
 class CLCKGen:
# GSM TDMA definitions
SEC_DELAY_US = 1000 * 1000
-   GSM_SUPERFRAME = 2715648
GSM_FRAME_US = 4615.0
 
# Average loop back delay
@@ -74,8 +74,8 @@
 
def send_clck_ind(self):
# Keep clock cycle
-   if self.clck_src % self.GSM_SUPERFRAME >= 0:
-   self.clck_src %= self.GSM_SUPERFRAME
+   if self.clck_src % GSM_HYPERFRAME >= 0:
+   self.clck_src %= GSM_HYPERFRAME
 
# We don't need to send so often
if self.clck_src % self.ind_period == 0:
diff --git a/src/target/fake_trx/data_if.py b/src/target/fake_trx/data_if.py
index 6662f98..0f373ab 100644
--- a/src/target/fake_trx/data_if.py
+++ b/src/target/fake_trx/data_if.py
@@ -25,10 +25,9 @@
 import random
 
 from udp_link import UDPLink
+from gsm_shared import *
 
 class DATAInterface(UDPLink):
-   # GSM PHY definitions
-   GSM_HYPERFRAME = 2048 * 26 * 51
 
def send_l1_msg(self, burst,
tn = None, fn = None, rssi = None):
@@ -38,7 +37,7 @@
 
# Generate random frame number if not preset
if fn is None:
-   fn = random.randint(0, self.GSM_HYPERFRAME)
+   fn = random.randint(0, GSM_HYPERFRAME)
 
# Generate random RSSI if not preset
if rssi is None:
@@ -79,7 +78,7 @@
 
# Generate random frame number if not preset
if fn is None:
-   fn = random.randint(0, self.GSM_HYPERFRAME)
+   fn = random.randint(0, GSM_HYPERFRAME)
 
# Generate random power level if not preset
if pwr is None:
diff --git a/src/target/fake_trx/gsm_shared.py 
b/src/target/fake_trx/gsm_shared.py
new file mode 100644
index 000..cfe94b0
--- /dev/null
+++ 

[PATCH] osmocom-bb[master]: trxcon/scheduler: drop meaningless TODO comment

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6818

trxcon/scheduler: drop meaningless TODO comment

Since both TA and AGC loops should be implemented in transceiver,
this TODO is meaningless. Let's drop it.

Change-Id: I84979712e2a1b849acaee53d5cd50de4e1e357c2
---
M src/host/trxcon/sched_lchan_xcch.c
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/18/6818/1

diff --git a/src/host/trxcon/sched_lchan_xcch.c 
b/src/host/trxcon/sched_lchan_xcch.c
index c71b10f..2015330 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -112,7 +112,6 @@
sched_send_data_ind(trx, ts, lchan,
l2, GSM_MACBLOCK_LEN, rc != 0, n_errors);
 
-   /* TODO: AGC, TA loops */
return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/6818
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84979712e2a1b849acaee53d5cd50de4e1e357c2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx: implement a new tool for TRX protocol sniffing

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6821

fake_trx: implement a new tool for TRX protocol sniffing

This change introduces a new tool, which could be used to sniff a
single connection between L1 and TRX in both directions, filter
captured bursts by direction, timeslot and/or frame number, and
finally write them to a binary file for further analysis.

Sniffing capability is based on Scapy framework, so it should
be installed in order to run this tool. Please also note,
that sniffing requires root access. For details, see:

https://github.com/secdev/scapy
https://scapy.readthedocs.io/en/latest/

Usage example:

  sudo ./trx_sniff --frame-count 30 --timeslot 2 -o /tmp/bursts

This command will capture 30 frames on timeslot number 2, and
write them to a binary file. The format of this file is based
on TLV (Tag Length Value), that wraps each burst:

  ... |-TAG (byte)-|-LEN (byte)-|-BURST (LEN bytes)-| ...

  TAG 0x01 - a message coming from L1 to TRX
  TAG 0x02 - a message coming from TRX to L1

Change-Id: I6e65e1d657574cc3e67bc7cdb1c01ef6bf08ecde
---
M src/target/fake_trx/README
A src/target/fake_trx/trx_sniff.py
2 files changed, 324 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/21/6821/1

diff --git a/src/target/fake_trx/README b/src/target/fake_trx/README
index 6e3ce03..5d4960f 100644
--- a/src/target/fake_trx/README
+++ b/src/target/fake_trx/README
@@ -31,3 +31,9 @@
   - burst_send.py - a tool for sending existing bursts from file
 or standard input either to L1 (OsmoBTS or OsmocomBB) or to
 TRX (OsmoTRX and GR-GSM TRX).
+
+  - trx_sniff.py - Scapy-based TRX protocol sniffer. Allows one
+to observe a single connection between TRX and L1, and vice
+versa. Also provides some capabilities for filtering bursts
+by direction, frame and timeslot numbers, and for recording
+captured messages to a binary file.
diff --git a/src/target/fake_trx/trx_sniff.py b/src/target/fake_trx/trx_sniff.py
new file mode 100755
index 000..cf3ab9c
--- /dev/null
+++ b/src/target/fake_trx/trx_sniff.py
@@ -0,0 +1,318 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# Scapy-based TRX interface sniffer
+#
+# (C) 2018 by Vadim Yanitskiy 
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import signal
+import getopt
+import sys
+
+import scapy.all
+
+COPYRIGHT = \
+   "Copyright (C) 2018 by Vadim Yanitskiy \n" \
+   "License GPLv2+: GNU GPL version 2 or later " \
+   "\n" \
+   "This is free software: you are free to change and redistribute it.\n" \
+   "There is NO WARRANTY, to the extent permitted by law.\n"
+
+class Application:
+   # Application variables
+   sniff_interface = "lo"
+   sniff_base_port = 5700
+   print_bursts = False
+   output_file = None
+
+   # Counters
+   cnt_burst_dropped_num = 0
+   cnt_burst_break = None
+   cnt_burst_num = 0
+
+   cnt_frame_break = None
+   cnt_frame_last = None
+   cnt_frame_num = 0
+
+   # Burst direction fliter
+   bf_dir_l12trx = None
+
+   # Timeslot number filter
+   bf_tn_val = None
+
+   # Frame number fliter
+   bf_fn_lt = None
+   bf_fn_gt = None
+
+   # Internal variables
+   lo_trigger = False
+
+   def __init__(self):
+   print(COPYRIGHT)
+   self.parse_argv()
+
+   # Open requested file for writing
+   if self.output_file is not None:
+   self.output_file = open(self.output_file, "ab")
+
+   def run(self):
+   # Compose a packet filter
+   pkt_filter = "udp and (port %d or port %d)" \
+   % (self.sniff_base_port + 2, self.sniff_base_port + 102)
+
+   print("[i] Listening on interface '%s'..." % 
self.sniff_interface)
+
+   # Start sniffing...
+   scapy.all.sniff(iface = self.sniff_interface, store = 1,
+   filter = pkt_filter, prn = self.pkt_handler)
+
+   # Scapy registers its own signal handler
+   self.shutdown()
+
+   def pkt_handler(self, ether):
+   # Prevent loopback packet duplication
+   if 

[PATCH] osmocom-bb[master]: fake_trx/burst_send.py: implement DATA capture support

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6836

fake_trx/burst_send.py: implement DATA capture support

Previously, this tool was only able to read a hand-crafted text
file with bursts and send them via the DATA interface. This is
not so useful...

This change implements support of reading DATA capture files,
which can be generated e.g. by trx_sniff.py or burst_gen.py.
Both standart input (stdio) and text-files are not supported
anymore.

Usage example:

  ./burst_send.py -m L1 -i capture.bin --timeslot 2

Change-Id: I626662bd1897c874421ab5178970ec19325f8a47
---
M src/target/fake_trx/README
M src/target/fake_trx/burst_send.py
2 files changed, 101 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/36/6836/1

diff --git a/src/target/fake_trx/README b/src/target/fake_trx/README
index 5d4960f..7b27414 100644
--- a/src/target/fake_trx/README
+++ b/src/target/fake_trx/README
@@ -28,9 +28,9 @@
 Currently it is only possible to generate random bursts of
 different types: NB, FB, SB, AB.
 
-  - burst_send.py - a tool for sending existing bursts from file
-or standard input either to L1 (OsmoBTS or OsmocomBB) or to
-TRX (OsmoTRX and GR-GSM TRX).
+  - burst_send.py - a tool for sending existing bursts from a
+capture file either to L1 (OsmoBTS or OsmocomBB) or to
+TRX (e.g. OsmoTRX or GR-GSM TRX).
 
   - trx_sniff.py - Scapy-based TRX protocol sniffer. Allows one
 to observe a single connection between TRX and L1, and vice
diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index b51ce5d..87f9228 100755
--- a/src/target/fake_trx/burst_send.py
+++ b/src/target/fake_trx/burst_send.py
@@ -25,12 +25,13 @@
 import getopt
 import sys
 
+from data_dump import DATADumpFile
 from data_if import DATAInterface
 from gsm_shared import *
 from data_msg import *
 
 COPYRIGHT = \
-   "Copyright (C) 2017 by Vadim Yanitskiy \n" \
+   "Copyright (C) 2017-2018 by Vadim Yanitskiy \n" \
"License GPLv2+: GNU GPL version 2 or later " \
"\n" \
"This is free software: you are free to change and redistribute it.\n" \
@@ -42,16 +43,17 @@
base_port = 5700
conn_mode = "TRX"
 
-   burst_src = None
-   
-   # Common header fields
-   fn = None
-   tn = None
+   # Burst source
+   capture_file = None
 
-   # Message specific header fields
-   rssi = None
-   toa = None
-   pwr = None
+   # Count limitations
+   msg_skip = None
+   msg_count = None
+
+   # Pass filtering
+   pf_fn_lt = None
+   pf_fn_gt = None
+   pf_tn = None
 
def __init__(self):
self.print_copyright()
@@ -60,81 +62,37 @@
# Set up signal handlers
signal.signal(signal.SIGINT, self.sig_handler)
 
+   # Open requested capture file
+   self.ddf = DATADumpFile(self.capture_file)
+
def run(self):
# Init DATA interface with TRX or L1
if self.conn_mode == "TRX":
self.data_if = DATAInterface(self.remote_addr,
self.base_port + 2, self.base_port + 102)
+   l12trx = True
elif self.conn_mode == "L1":
self.data_if = DATAInterface(self.remote_addr,
self.base_port + 102, self.base_port + 2)
+   l12trx = False
else:
self.print_help("[!] Unknown connection type")
sys.exit(2)
 
-   # Open the burst source (file or stdin)
-   if self.burst_src is not None:
-   print("[i] Reading bursts from file '%s'..." % 
self.burst_src)
-   src = open(self.burst_src, "r")
-   else:
-   print("[i] Reading bursts from stdin...")
-   src = sys.stdin
+   # Read messages from the capture
+   messages = self.ddf.parse_all(
+   skip = self.msg_skip, count = self.msg_count)
+   if messages is False:
+   pass # FIXME!!!
 
-   # Init an empty DATA message
-   if self.conn_mode == "TRX":
-   msg = DATAMSG_L12TRX()
-   elif self.conn_mode == "L1":
-   msg = DATAMSG_TRX2L1()
-
-   # Generate a random frame number or use provided one
-   fn = msg.rand_fn() if self.fn is None else self.fn
-
-   # Read the burst source line-by-line
-   for line in src:
-   # Strip spaces
-   burst_str = line.strip()
-   burst = []
-
-   # Check length
-   if len(burst_str) not in 

[PATCH] osmocom-bb[master]: fake_trx/data_dump.py: use 2 bytes to store message length

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6837

fake_trx/data_dump.py: use 2 bytes to store message length

One byte may store a value in range [0x00, 0xff]. The maximal 0xff
value is 255 in dec, so a message length is limited to 255 bytes.
This is enough for GSM bursts, but not for EDGE.

Since this change, two bytes of header are used to store the
pending message length. All captures created before are not
supported anymore...

Change-Id: I5a69d5cf2914fe56b2f9acca6054c9470627f91e
---
M src/target/fake_trx/data_dump.py
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/6837/1

diff --git a/src/target/fake_trx/data_dump.py b/src/target/fake_trx/data_dump.py
index b904736..56e314c 100644
--- a/src/target/fake_trx/data_dump.py
+++ b/src/target/fake_trx/data_dump.py
@@ -30,7 +30,7 @@
# Constants
TAG_L12TRX = '\x01'
TAG_TRX2L1 = '\x02'
-   HDR_LENGTH = 2
+   HDR_LENGTH = 3
 
# Generates raw bytes from a DATA message
# Return value: raw message bytes
@@ -46,15 +46,18 @@
# Generate a message payload
msg_raw = msg.gen_msg()
 
-   # Calculate the length
+   # Calculate and pack the message length
msg_len = len(msg_raw)
 
+   # Pack to unsigned short (2 bytes, BE)
+   msg_len = struct.pack(">H", msg_len)
+
# Concatenate a message with header
-   return bytearray([tag, msg_len]) + msg_raw
+   return bytearray(tag + msg_len) + msg_raw
 
def parse_hdr(self, hdr):
# Extract the header info
-   msg_len = struct.unpack("H", hdr[1:3])[0]
tag = hdr[0]
 
# Check if tag is known

-- 
To view, visit https://gerrit.osmocom.org/6837
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a69d5cf2914fe56b2f9acca6054c9470627f91e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/data_msg.py: handle bursts properly

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6825

fake_trx/data_msg.py: handle bursts properly

One L1 -> TRX message carries one to be transmitted burst encoded
as regular bits (0 or 1). One TRX -> L1 message carries one
received burst encoded as unsigned soft-bits (0..254).

This shall be noted during message encoding and decoding process.
Also, we shall distinguish between GSM and EDGE bursts.

Change-Id: I909b7a4dc70e8c632987bde07f00281a6595c4cb
---
M src/target/fake_trx/data_msg.py
1 file changed, 65 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/25/6825/1

diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py
index c561280..2805113 100644
--- a/src/target/fake_trx/data_msg.py
+++ b/src/target/fake_trx/data_msg.py
@@ -44,6 +44,14 @@
def parse_hdr(self, hdr):
raise NotImplementedError
 
+   # Generates message specific burst
+   def gen_burst(self):
+   raise NotImplementedError
+
+   # Parses message specific burst
+   def parse_burst(self, burst):
+   raise NotImplementedError
+
# Generates a random frame number
def rand_fn(self):
return random.randint(0, GSM_HYPERFRAME)
@@ -159,9 +167,8 @@
hdr = self.gen_hdr()
buf += hdr
 
-   # Put burst
-   # TODO: distinguish between: usbits, ubits and sbits
-   buf += bytearray(self.burst)
+   # Generate burst
+   buf += self.gen_burst()
 
return buf
 
@@ -182,7 +189,8 @@
self.parse_hdr(msg)
 
# Copy burst, skipping header
-   self.burst = msg[self.HDR_LEN:]
+   msg_burst = msg[self.HDR_LEN:]
+   self.parse_burst(msg_burst)
 
 class DATAMSG_L12TRX(DATAMSG):
# Constants
@@ -243,6 +251,21 @@
def parse_hdr(self, hdr):
# Parse power level
self.pwr = hdr[5]
+
+   # Generates message specific burst
+   def gen_burst(self):
+   # Copy burst 'as is'
+   return bytearray(self.burst)
+
+   # Parses message specific burst
+   def parse_burst(self, burst):
+   length = len(burst)
+
+   # Distinguish between GSM and EDGE
+   if length >= EDGE_BURST_LEN:
+   self.burst = list(burst[:EDGE_BURST_LEN])
+   else:
+   self.burst = list(burst[:GSM_BURST_LEN])
 
 class DATAMSG_TRX2L1(DATAMSG):
# Constants
@@ -338,17 +361,46 @@
# FIXME: parsing unsupported
self.toa = None
 
+   # Generates message specific burst
+   def gen_burst(self):
+   # Convert soft-bits to unsigned soft-bits
+   burst_usbits = self.sbit2usbit(self.burst)
+
+   # Encode to bytes
+   return bytearray(burst_usbits)
+
+   # Parses message specific burst
+   def parse_burst(self, burst):
+   length = len(burst)
+
+   # Distinguish between GSM and EDGE
+   if length >= EDGE_BURST_LEN:
+   burst_usbits = list(burst[:EDGE_BURST_LEN])
+   else:
+   burst_usbits = list(burst[:GSM_BURST_LEN])
+
+   # Convert unsigned soft-bits to soft-bits
+   burst_sbits = self.usbit2sbit(burst_usbits)
+
+   # Save
+   self.burst = burst_sbits
+
 # Regression test
 if __name__ == '__main__':
# Common reference data
fn = 1024
tn = 0
 
-   # Generate a random burst
-   burst = bytearray()
+   # Generate two random bursts
+   burst_l12trx_ref = []
+   burst_trx2l1_ref = []
+
for i in range(0, GSM_BURST_LEN):
-   byte = random.randint(0x00, 0xff)
-   burst.append(byte)
+   ubit = random.randint(0, 1)
+   burst_l12trx_ref.append(ubit)
+
+   sbit = random.randint(-127, 127)
+   burst_trx2l1_ref.append(sbit)
 
print("[i] Generating the reference messages")
 
@@ -361,9 +413,9 @@
msg_l12trx_ref.pwr = 0x33
msg_trx2l1_ref.toa = -0.6
 
-   # Specify the reference burst
-   msg_trx2l1_ref.burst = burst
-   msg_l12trx_ref.burst = burst
+   # Specify the reference bursts
+   msg_l12trx_ref.burst = burst_l12trx_ref
+   msg_trx2l1_ref.burst = burst_trx2l1_ref
 
print("[i] Encoding the reference messages")
 
@@ -382,8 +434,8 @@
print("[i] Comparing decoded messages with the reference")
 
# Compare bursts
-   assert(msg_l12trx_dec.burst == burst)
-   assert(msg_trx2l1_dec.burst == burst)
+   assert(msg_l12trx_dec.burst == burst_l12trx_ref)
+   assert(msg_trx2l1_dec.burst == burst_trx2l1_ref)
 
print("[?] Compare bursts: OK")
 

-- 
To view, visit https://gerrit.osmocom.org/6825
To unsubscribe, 

[PATCH] osmocom-bb[master]: fake_trx/burst_gen.py: check argv separately

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6827

fake_trx/burst_gen.py: check argv separately

Change-Id: I35b5475d3b6df6dc92a1981c693afb63df866c87
---
M src/target/fake_trx/burst_gen.py
1 file changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/6827/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index 68ba0ec..66d8e89 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -53,6 +53,7 @@
def __init__(self):
self.print_copyright()
self.parse_argv()
+   self.check_argv()
 
# Set up signal handlers
signal.signal(signal.SIGINT, self.sig_handler)
@@ -65,9 +66,6 @@
elif self.conn_mode == "L1":
self.data_if = DATAInterface(self.remote_addr,
self.base_port + 102, self.base_port + 2)
-   else:
-   self.print_help("[!] Unknown connection type")
-   sys.exit(2)
 
# Init random burst generator
self.gen = RandBurstGen()
@@ -89,10 +87,6 @@
buf = self.gen.gen_sb()
elif self.burst_type == "AB":
buf = self.gen.gen_ab()
-   else:
-   self.print_help("[!] Unknown burst type")
-   self.shutdown()
-   sys.exit(2)
 
print("[i] Sending %d/%d %s burst (fn=%u) to %s..."
% (i + 1, self.burst_count, self.burst_type,
@@ -178,6 +172,17 @@
elif o in ("-l", "--power-level"):
self.pwr = abs(int(v))
 
+   def check_argv(self):
+   # Check connection mode
+   if self.conn_mode not in ("TRX", "L1"):
+   self.print_help("[!] Unknown connection type")
+   sys.exit(2)
+
+   # Check connection mode
+   if self.burst_type not in ("NB", "FB", "SB", "AB"):
+   self.print_help("[!] Unknown burst type")
+   sys.exit(2)
+
def shutdown(self):
self.data_if.shutdown()
 

-- 
To view, visit https://gerrit.osmocom.org/6827
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35b5475d3b6df6dc92a1981c693afb63df866c87
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx: implement classes for DATA capture menagement

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6833

fake_trx: implement classes for DATA capture menagement

This change introduces the following classes:

  - DATADump - basic class, which contains methods to generate
and parse the a message header, and some constants.

  - DATADumpFile - a child class, which contains methods to
write and parse DATA messages from capture files.

Usage example:

  # Open a capture file
  ddf = DATADumpFile("capture.bin")

  # Parse the 10th message
  msg = ddf.parse_msg(10)
  msg.fn = 100
  msg.tn = 0

  # Append one to the end of the capture
  ddf.append_msg(msg)

Change-Id: I1b31183bd7bcca94de089847ee0b2f4ec88a7f1d
---
A src/target/fake_trx/data_dump.py
1 file changed, 379 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/33/6833/1

diff --git a/src/target/fake_trx/data_dump.py b/src/target/fake_trx/data_dump.py
new file mode 100644
index 000..b904736
--- /dev/null
+++ b/src/target/fake_trx/data_dump.py
@@ -0,0 +1,379 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# TRX Toolkit
+# Helpers for DATA capture management
+#
+# (C) 2018 by Vadim Yanitskiy 
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import struct
+
+from data_msg import *
+
+class DATADump:
+   # Constants
+   TAG_L12TRX = '\x01'
+   TAG_TRX2L1 = '\x02'
+   HDR_LENGTH = 2
+
+   # Generates raw bytes from a DATA message
+   # Return value: raw message bytes
+   def dump_msg(self, msg):
+   # Determine a message type
+   if isinstance(msg, DATAMSG_L12TRX):
+   tag = self.TAG_L12TRX
+   elif isinstance(msg, DATAMSG_TRX2L1):
+   tag = self.TAG_TRX2L1
+   else:
+   raise ValueError("Unknown message type")
+
+   # Generate a message payload
+   msg_raw = msg.gen_msg()
+
+   # Calculate the length
+   msg_len = len(msg_raw)
+
+   # Concatenate a message with header
+   return bytearray([tag, msg_len]) + msg_raw
+
+   def parse_hdr(self, hdr):
+   # Extract the header info
+   msg_len = struct.unpack(" TRX
+   msg = DATAMSG_L12TRX()
+   elif tag == self.TAG_TRX2L1:
+   # TRX -> L1
+   msg = DATAMSG_TRX2L1()
+   else:
+   # Unknown tag
+   return False
+
+   return (msg, msg_len)
+
+class DATADumpFile(DATADump):
+   def __init__(self, capture):
+   # Check if capture file is already opened
+   if type(capture) is file:
+   self.f = capture
+   else:
+   print("[i] Opening capture file '%s'..." % capture)
+   self.f = open(capture, "a+b")
+
+   def __del__(self):
+   print("[i] Closing the capture file")
+   self.f.close()
+
+   # Moves the file descriptor before a specified message
+   # Return value:
+   #   True in case of success,
+   #   or False in case of EOF or header parsing error.
+   def _seek2msg(self, idx):
+   # Seek to the begining of the capture
+   self.f.seek(0)
+
+   # Read the capture in loop...
+   for i in range(idx):
+   # Attempt to read a message header
+   hdr_raw = self.f.read(self.HDR_LENGTH)
+   if len(hdr_raw) != self.HDR_LENGTH:
+   return False
+
+   # Attempt to parse it
+   rc = self.parse_hdr(hdr_raw)
+   if rc is False:
+   print("[!] Couldn't parse a message header")
+   return False
+
+   # Expand the header
+   (_, msg_len) = rc
+
+   # Skip a message
+   self.f.seek(msg_len, 1)
+
+   return True
+
+

[PATCH] osmocom-bb[master]: trxcon: change default port number to 5703 to avoid clashes ...

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6838

trxcon: change default port number to 5703 to avoid clashes with osmo-bts-trx

See https://osmocom.org/issues/2984 for the kind of issue I'm trying to
avoid with this patch.  Let's make sure that the default configuration
cannot fail in weird ways.

Change-Id: I66b5f25aaba3b836448ed29839c39869b5622bed
Related: OS#2984
---
M src/host/trxcon/trxcon.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/38/6838/1

diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 07ab169..9c590ac 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -143,7 +143,7 @@
printf("  -h --help this text\n");
printf("  -d --debugChange debug flags. Default: %s\n", 
DEBUG_DEFAULT);
printf("  -i --trx-ip   IP address of host runing TRX (default 
127.0.0.1)\n");
-   printf("  -p --trx-port Base port of TRX instance (default 
5700)\n");
+   printf("  -p --trx-port Base port of TRX instance (default 
5703)\n");
printf("  -f --trx-advance  Scheduler clock advance (default 20)\n");
printf("  -s --socket   Listening socket for layer23 (default 
/tmp/osmocom_l2)\n");
printf("  -D --daemonizeRun as daemon\n");
@@ -203,7 +203,7 @@
 {
app_data.bind_socket = "/tmp/osmocom_l2";
app_data.trx_ip = "127.0.0.1";
-   app_data.trx_base_port = 5700;
+   app_data.trx_base_port = 5703;
app_data.trx_fn_advance = 20;
 
app_data.debug_mask = NULL;

-- 
To view, visit https://gerrit.osmocom.org/6838
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66b5f25aaba3b836448ed29839c39869b5622bed
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/burst_gen.py: also handle RSSI and ToA values

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6830

fake_trx/burst_gen.py: also handle RSSI and ToA values

Change-Id: I7c9441c1154c925dcb5c743e39445495233c123e
---
M src/target/fake_trx/burst_gen.py
1 file changed, 29 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/30/6830/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index ced2de3..9141b67 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -46,9 +46,15 @@
 
burst_type = None
burst_count = 1
-   pwr = None
+
+   # Common header fields
fn = None
tn = None
+
+   # Message specific header fields
+   rssi = None
+   toa = None
+   pwr = None
 
def __init__(self):
self.print_copyright()
@@ -95,7 +101,13 @@
if self.pwr is not None:
msg.pwr = self.pwr
 
-   # TODO: also set TRX2L1 specific fields
+   # Set time of arrival
+   if self.toa is not None:
+   msg.toa = self.toa
+
+   # Set RSSI
+   if self.rssi is not None:
+   msg.rssi = self.rssi
 
# Generate a random burst
if self.burst_type == "NB":
@@ -141,7 +153,9 @@
 "  -c --burst-countHow much bursts to send 
(default 1)\n"   \
 "  -f --frame-number   Set frame number (default 
random)\n" \
 "  -t --timeslot   Set timeslot index (default 
random)\n"   \
-"  -l --power-levelSet transmit level (default 
random)\n"   \
+" --pwrSet power level (default 
random)\n"  \
+" --rssi   Set RSSI (default random)\n"
 \
+" --toaSet TOA (default random)\n\n"
 
print(s % (self.remote_addr, self.base_port))
 
@@ -151,7 +165,7 @@
def parse_argv(self):
try:
opts, args = getopt.getopt(sys.argv[1:],
-   "m:r:p:b:c:f:t:l:h",
+   "m:r:p:b:c:f:t:h",
[
"help",
"conn-mode=",
@@ -161,7 +175,9 @@
"burst-count=",
"frame-number=",
"timeslot=",
-   "power-level=",
+   "rssi=",
+   "toa=",
+   "pwr=",
])
except getopt.GetoptError as err:
self.print_help("[!] " + str(err))
@@ -187,8 +203,14 @@
self.fn = int(v)
elif o in ("-t", "--timeslot"):
self.tn = int(v)
-   elif o in ("-l", "--power-level"):
-   self.pwr = abs(int(v))
+
+   # Message specific header fields
+   elif o == "--pwr":
+   self.pwr = int(v)
+   elif o == "--rssi":
+   self.rssi = int(v)
+   elif o == "--toa":
+   self.toa = float(v)
 
def check_argv(self):
# Check connection mode

-- 
To view, visit https://gerrit.osmocom.org/6830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c9441c1154c925dcb5c743e39445495233c123e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/burst_gen.py: don't store RandBurstGen

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6828

fake_trx/burst_gen.py: don't store RandBurstGen

No need to keep it as a class member.

Change-Id: I5bf5846c2b8fa1211cf5150545b9d001c17fa0eb
---
M src/target/fake_trx/burst_gen.py
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/28/6828/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index 66d8e89..04b7f47 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -68,7 +68,7 @@
self.base_port + 102, self.base_port + 2)
 
# Init random burst generator
-   self.gen = RandBurstGen()
+   burst_gen = RandBurstGen()
 
# Generate a random frame number or use provided one
if self.fn is None:
@@ -80,13 +80,13 @@
for i in range(self.burst_count):
# Generate a random burst
if self.burst_type == "NB":
-   buf = self.gen.gen_nb()
+   buf = burst_gen.gen_nb()
elif self.burst_type == "FB":
-   buf = self.gen.gen_fb()
+   buf = burst_gen.gen_fb()
elif self.burst_type == "SB":
-   buf = self.gen.gen_sb()
+   buf = burst_gen.gen_sb()
elif self.burst_type == "AB":
-   buf = self.gen.gen_ab()
+   buf = burst_gen.gen_ab()
 
print("[i] Sending %d/%d %s burst (fn=%u) to %s..."
% (i + 1, self.burst_count, self.burst_type,

-- 
To view, visit https://gerrit.osmocom.org/6828
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bf5846c2b8fa1211cf5150545b9d001c17fa0eb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/burst_gen.py: add burst capture support

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6835

fake_trx/burst_gen.py: add burst capture support

Now all generated bursts can be also written to a capture file,
using a new option called '--output-file'. If a file already
exists, bursts would be appended to the end. Otherwise a new
capture file is created.

Change-Id: I074ff7dbc4d6beecdecce20de9dade5939e707f2
---
M src/target/fake_trx/burst_gen.py
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/35/6835/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index 9141b67..9f36687 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -27,6 +27,7 @@
 import sys
 
 from rand_burst_gen import RandBurstGen
+from data_dump import DATADumpFile
 from data_if import DATAInterface
 from gsm_shared import *
 from data_msg import *
@@ -43,6 +44,7 @@
remote_addr = "127.0.0.1"
base_port = 5700
conn_mode = "TRX"
+   output_file = None
 
burst_type = None
burst_count = 1
@@ -63,6 +65,10 @@
 
# Set up signal handlers
signal.signal(signal.SIGINT, self.sig_handler)
+
+   # Open requested capture file
+   if self.output_file is not None:
+   self.ddf = DATADumpFile(self.output_file)
 
def run(self):
# Init DATA interface with TRX or L1
@@ -133,6 +139,10 @@
# Send message
self.data_if.send_msg(msg)
 
+   # Append a new message to the capture
+   if self.output_file is not None:
+   self.ddf.append_msg(msg)
+
self.shutdown()
 
def print_copyright(self):
@@ -144,6 +154,7 @@
 "  -h --help   this text\n\n"
 
s += " TRX interface specific\n" \
+"  -o --output-fileWrite bursts to a capture 
file\n"\
 "  -m --conn-mode  Send bursts to: TRX (default) / 
L1\n"\
 "  -r --remote-addrSet remote address (default 
%s)\n"   \
 "  -p --base-port  Set base port number (default 
%d)\n\n"
@@ -165,9 +176,10 @@
def parse_argv(self):
try:
opts, args = getopt.getopt(sys.argv[1:],
-   "m:r:p:b:c:f:t:h",
+   "o:m:r:p:b:c:f:t:h",
[
"help",
+   "output-file="
"conn-mode=",
"remote-addr=",
"base-port=",
@@ -188,6 +200,8 @@
self.print_help()
sys.exit(2)
 
+   elif o in ("-o", "--output-file"):
+   self.output_file = v
elif o in ("-m", "--conn-mode"):
self.conn_mode = v
elif o in ("-r", "--remote-addr"):

-- 
To view, visit https://gerrit.osmocom.org/6835
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I074ff7dbc4d6beecdecce20de9dade5939e707f2
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/burst_send.py: also handle RSSI and ToA values

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6831

fake_trx/burst_send.py: also handle RSSI and ToA values

Change-Id: Idb9a5ae4a8980a320f6e620c66add7c7393d3ecb
---
M src/target/fake_trx/burst_send.py
1 file changed, 29 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/31/6831/1

diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index 4dbe984..7367925 100755
--- a/src/target/fake_trx/burst_send.py
+++ b/src/target/fake_trx/burst_send.py
@@ -43,9 +43,15 @@
conn_mode = "TRX"
 
burst_src = None
-   pwr = None
+   
+   # Common header fields
fn = None
tn = None
+
+   # Message specific header fields
+   rssi = None
+   toa = None
+   pwr = None
 
def __init__(self):
self.print_copyright()
@@ -108,7 +114,13 @@
if self.pwr is not None:
msg.pwr = self.pwr
 
-   # TODO: also set TRX2L1 specific fields
+   # Set time of arrival
+   if self.toa is not None:
+   msg.toa = self.toa
+
+   # Set RSSI
+   if self.rssi is not None:
+   msg.rssi = self.rssi
 
# Parse a string
for bit in burst_str:
@@ -153,7 +165,9 @@
 "  -i --burst-file Read bursts from file (default 
stdin)\n" \
 "  -f --frame-number   Set frame number (default 
random)\n" \
 "  -t --timeslot   Set timeslot index (default 
random)\n"   \
-"  -l --power-levelSet transmit level (default 
random)\n"   \
+" --pwrSet power level (default 
random)\n"  \
+" --rssi   Set RSSI (default random)\n"
 \
+" --toaSet TOA (default random)\n\n"
 
print(s % (self.remote_addr, self.base_port))
 
@@ -163,7 +177,7 @@
def parse_argv(self):
try:
opts, args = getopt.getopt(sys.argv[1:],
-   "m:r:p:i:f:t:l:h",
+   "m:r:p:i:f:t:h",
[
"help",
"conn-mode=",
@@ -172,7 +186,9 @@
"burst-file=",
"frame-number=",
"timeslot=",
-   "power-level=",
+   "rssi=",
+   "toa=",
+   "pwr=",
])
except getopt.GetoptError as err:
self.print_help("[!] " + str(err))
@@ -196,8 +212,14 @@
self.fn = int(v)
elif o in ("-t", "--timeslot"):
self.tn = int(v)
-   elif o in ("-l", "--power-level"):
-   self.pwr = abs(int(v))
+
+   # Message specific header fields
+   elif o == "--pwr":
+   self.pwr = int(v)
+   elif o == "--rssi":
+   self.rssi = int(v)
+   elif o == "--toa":
+   self.toa = float(v)
 
def shutdown(self):
self.data_if.shutdown()

-- 
To view, visit https://gerrit.osmocom.org/6831
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb9a5ae4a8980a320f6e620c66add7c7393d3ecb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/data_msg.py: implement header description

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6826

fake_trx/data_msg.py: implement header description

This change introduces a new method for both types of messages
called 'desc_hdr', that generates human-readable header
description.

Examples:

  TRX -> L1: fn=571353 tn=1 rssi=-108 toa=-0.53
  L1 -> TRX: fn=1777477 tn=3 pwr=161

Change-Id: Iafe63e39ad68f4ff373ae098424d76ca9f83c8fc
---
M src/target/fake_trx/data_msg.py
1 file changed, 37 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/26/6826/1

diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py
index 2805113..77d4f52 100644
--- a/src/target/fake_trx/data_msg.py
+++ b/src/target/fake_trx/data_msg.py
@@ -65,6 +65,18 @@
self.fn = self.rand_fn()
self.tn = self.rand_tn()
 
+   # Generates human-readable header description
+   def desc_hdr(self):
+   result = ""
+
+   if self.fn is not None:
+   result += ("fn=%u " % self.fn)
+
+   if self.tn is not None:
+   result += ("tn=%u " % self.tn)
+
+   return result
+
# Converts unsigned soft-bits {254..0} to soft-bits {-127..127}
def usbit2sbit(self, bits):
buf = []
@@ -237,6 +249,17 @@
DATAMSG.rand_hdr(self)
self.pwr = self.rand_pwr()
 
+   # Generates human-readable header description
+   def desc_hdr(self):
+   # Describe the common part
+   result = DATAMSG.desc_hdr(self)
+
+   if self.pwr is not None:
+   result += ("pwr=%u " % self.pwr)
+
+   # Strip useless whitespace and return
+   return result.strip()
+
# Generates message specific header part
def gen_hdr(self):
# Allocate an empty byte-array
@@ -335,6 +358,20 @@
self.rssi = self.rand_rssi()
self.toa = self.rand_toa()
 
+   # Generates human-readable header description
+   def desc_hdr(self):
+   # Describe the common part
+   result = DATAMSG.desc_hdr(self)
+
+   if self.rssi is not None:
+   result += ("rssi=%d " % self.rssi)
+
+   if self.toa is not None:
+   result += ("toa=%.2f " % self.toa)
+
+   # Strip useless whitespace and return
+   return result.strip()
+
# Generates message specific header part
def gen_hdr(self):
# Allocate an empty byte-array

-- 
To view, visit https://gerrit.osmocom.org/6826
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafe63e39ad68f4ff373ae098424d76ca9f83c8fc
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx/data_msg.py: implement header randomization

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6824

fake_trx/data_msg.py: implement header randomization

This feature could be used by both burst_gen.py and burst_send.py.

Change-Id: I724e267382ff32ef1f964b1ee6cbe99069139867
---
M src/target/fake_trx/data_msg.py
1 file changed, 64 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/24/6824/1

diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py
index 9acc0f1..c561280 100644
--- a/src/target/fake_trx/data_msg.py
+++ b/src/target/fake_trx/data_msg.py
@@ -44,6 +44,19 @@
def parse_hdr(self, hdr):
raise NotImplementedError
 
+   # Generates a random frame number
+   def rand_fn(self):
+   return random.randint(0, GSM_HYPERFRAME)
+
+   # Generates a random timeslot number
+   def rand_tn(self):
+   return random.randint(0, 7)
+
+   # Randomizes the message header
+   def rand_hdr(self):
+   self.fn = self.rand_fn()
+   self.tn = self.rand_tn()
+
# Converts unsigned soft-bits {254..0} to soft-bits {-127..127}
def usbit2sbit(self, bits):
buf = []
@@ -201,6 +214,21 @@
 
return True
 
+   # Generates a random power level
+   def rand_pwr(self, min = None, max = None):
+   if min is None:
+   min = self.PWR_MIN
+
+   if max is None:
+   max = self.PWR_MAX
+
+   return random.randint(min, max)
+
+   # Randomizes message specific header
+   def rand_hdr(self):
+   DATAMSG.rand_hdr(self)
+   self.pwr = self.rand_pwr()
+
# Generates message specific header part
def gen_hdr(self):
# Allocate an empty byte-array
@@ -257,6 +285,32 @@
return False
 
return True
+
+   # Generates a random RSSI value
+   def rand_rssi(self, min = None, max = None):
+   if min is None:
+   min = self.RSSI_MIN
+
+   if max is None:
+   max = self.RSSI_MAX
+
+   return random.randint(min, max)
+
+   # Generates a ToA (Time of Arrival) value
+   def rand_toa(self, min = None, max = None):
+   if min is None:
+   min = self.TOA_MIN
+
+   if max is None:
+   max = self.TOA_MAX
+
+   return random.uniform(min, max)
+
+   # Randomizes message specific header
+   def rand_hdr(self):
+   DATAMSG.rand_hdr(self)
+   self.rssi = self.rand_rssi()
+   self.toa = self.rand_toa()
 
# Generates message specific header part
def gen_hdr(self):
@@ -350,6 +404,16 @@
 
print("[?] Compare message specific data: OK")
 
+   # Validate header randomization
+   for i in range(0, 100):
+   msg_l12trx_ref.rand_hdr()
+   msg_trx2l1_ref.rand_hdr()
+
+   assert(msg_l12trx_ref.validate())
+   assert(msg_trx2l1_ref.validate())
+
+   print("[?] Validate header randomization: OK")
+
# Bit conversation test
usbits_ref = range(0, 256)
sbits_ref = range(-127, 128)

-- 
To view, visit https://gerrit.osmocom.org/6824
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I724e267382ff32ef1f964b1ee6cbe99069139867
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx: implement classes for DATA messages

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6823

fake_trx: implement classes for DATA messages

This change introduces three new classes:

  - DATAMSG - abstract class, defines common fields and methods
for any message on DATA interface, e.g. frame and timeslot
numbers, bit conversation methods, etc.

  - DATAMSG_L12TRX - a child of DATAMSG, defines a message
coming from L1 to TRX.

  - DATAMSG_TRX2L1 - a child of DATAMSG, defines a message
coming from TRX to L1.

Both child classes could be used to generate DATA messages from
known fields (i.e. fn, tn, etc.), and parse them back from
already encoded DATA messages.

Change-Id: Id1c72f0b18fb128acc74d0cd899fb7aab7bd8790
---
A src/target/fake_trx/data_msg.py
1 file changed, 372 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/23/6823/1

diff --git a/src/target/fake_trx/data_msg.py b/src/target/fake_trx/data_msg.py
new file mode 100644
index 000..9acc0f1
--- /dev/null
+++ b/src/target/fake_trx/data_msg.py
@@ -0,0 +1,372 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+# Virtual Um-interface (fake transceiver)
+# DATA interface message definitions and helpers
+#
+# (C) 2018 by Vadim Yanitskiy 
+#
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import random
+
+from gsm_shared import *
+
+class DATAMSG:
+   # Common message fields
+   burst = None
+   fn = None
+   tn = None
+
+   # HACK: Abstract class definition
+   def __init__(self):
+   raise NotImplementedError
+
+   # Generates message specific header
+   def gen_hdr(self):
+   raise NotImplementedError
+
+   # Parses message specific header
+   def parse_hdr(self, hdr):
+   raise NotImplementedError
+
+   # Converts unsigned soft-bits {254..0} to soft-bits {-127..127}
+   def usbit2sbit(self, bits):
+   buf = []
+
+   for bit in bits:
+   if bit == 0xff:
+   buf.append(-127)
+   else:
+   buf.append(127 - bit)
+
+   return buf
+
+   # Converts soft-bits {-127..127} to unsigned soft-bits {254..0}
+   def sbit2usbit(self, bits):
+   buf = []
+
+   for bit in bits:
+   buf.append(127 - bit)
+
+   return buf
+
+   # Converts soft-bits {-127..127} to bits {1..0}
+   def sbit2ubit(self, bits):
+   buf = []
+
+   for bit in bits:
+   buf.append(1 if bit < 0 else 0)
+
+   return buf
+
+   # Converts bits {1..0} to soft-bits {-127..127}
+   def ubit2sbit(self, bits):
+   buf = []
+
+   for bit in bits:
+   buf.append(-127 if bit else 127)
+
+   return buf
+
+   # Validates the message fields
+   def validate(self):
+   if self.burst is None:
+   return False
+
+   if len(self.burst) not in (GSM_BURST_LEN, EDGE_BURST_LEN):
+   return False
+
+   if self.fn is None:
+   return False
+
+   if self.fn < 0 or self.fn > GSM_HYPERFRAME:
+   return False
+
+   if self.tn is None:
+   return False
+
+   if self.tn < 0 or self.tn > 7:
+   return False
+
+   return True
+
+   # Generates frame number to bytes
+   def gen_fn(self, fn):
+   # Allocate an empty byte-array
+   buf = bytearray()
+
+   # Big endian, 4 bytes
+   buf.append((fn >> 24) & 0xff)
+   buf.append((fn >> 16) & 0xff)
+   buf.append((fn >>  8) & 0xff)
+   buf.append((fn >>  0) & 0xff)
+
+   return buf
+
+   # Parses frame number from bytes
+   def parse_fn(self, buf):
+   # Big endian, 4 bytes
+   return (buf[0] << 24) \
+| (buf[1] << 16) \
+| (buf[2] << 8)  \
+| (buf[3] << 0)
+
+   # Generates a TRX DATA message
+   def gen_msg(self):
+   # 

[PATCH] osmocom-bb[master]: fake_trx/burst_send.py: handle both GSM and EDGE bursts

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6832

fake_trx/burst_send.py: handle both GSM and EDGE bursts

Previously, it was expected that burst length should be equal
to 148. Let's also handle EDGE bursts and use GSM constants.

Change-Id: Iab13dd06f175556137c5e25d2cbddb9bea403b09
---
M src/target/fake_trx/burst_send.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/6832/1

diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index 7367925..b51ce5d 100755
--- a/src/target/fake_trx/burst_send.py
+++ b/src/target/fake_trx/burst_send.py
@@ -96,8 +96,8 @@
burst = []
 
# Check length
-   if len(burst_str) != 148:
-   print("[!] Dropping burst due to length != 148")
+   if len(burst_str) not in (GSM_BURST_LEN, 
EDGE_BURST_LEN):
+   print("[!] Dropping burst due to incorrect 
length")
continue
 
# Randomize the message header

-- 
To view, visit https://gerrit.osmocom.org/6832
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab13dd06f175556137c5e25d2cbddb9bea403b09
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmocom-bb[master]: fake_trx: use DATAMSG classes for DATA messages

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6829

fake_trx: use DATAMSG classes for DATA messages

The DATAMSG API, that was introduced and extended a few commits
before, provides all required methods to create, validate,
generate and parse DATA messages. Let's use it now.

Change-Id: Ibc99126dc05d873c1ba538a5f4e74866de563f56
---
M src/target/fake_trx/burst_gen.py
M src/target/fake_trx/burst_send.py
M src/target/fake_trx/data_if.py
M src/target/fake_trx/trx_sniff.py
4 files changed, 114 insertions(+), 157 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/29/6829/1

diff --git a/src/target/fake_trx/burst_gen.py b/src/target/fake_trx/burst_gen.py
index 04b7f47..ced2de3 100755
--- a/src/target/fake_trx/burst_gen.py
+++ b/src/target/fake_trx/burst_gen.py
@@ -4,7 +4,7 @@
 # Auxiliary tool to generate and send random bursts via TRX DATA
 # interface, which may be useful for fuzzing and testing
 #
-# (C) 2017 by Vadim Yanitskiy 
+# (C) 2017-2018 by Vadim Yanitskiy 
 #
 # All Rights Reserved
 #
@@ -22,7 +22,6 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-import random
 import signal
 import getopt
 import sys
@@ -30,6 +29,7 @@
 from rand_burst_gen import RandBurstGen
 from data_if import DATAInterface
 from gsm_shared import *
+from data_msg import *
 
 COPYRIGHT = \
"Copyright (C) 2017 by Vadim Yanitskiy \n" \
@@ -70,38 +70,56 @@
# Init random burst generator
burst_gen = RandBurstGen()
 
+   # Init an empty DATA message
+   if self.conn_mode == "TRX":
+   msg = DATAMSG_L12TRX()
+   elif self.conn_mode == "L1":
+   msg = DATAMSG_TRX2L1()
+
# Generate a random frame number or use provided one
-   if self.fn is None:
-   fn = random.randint(0, GSM_HYPERFRAME)
-   else:
-   fn = self.fn
+   fn_init = msg.rand_fn() if self.fn is None else self.fn
 
# Send as much bursts as required
for i in range(self.burst_count):
+   # Randomize the message header
+   msg.rand_hdr()
+
+   # Increase and set frame number
+   msg.fn = (fn_init + i) % GSM_HYPERFRAME
+
+   # Set timeslot number
+   if self.tn is not None:
+   msg.tn = self.tn
+
+   # Set transmit power level
+   if self.pwr is not None:
+   msg.pwr = self.pwr
+
+   # TODO: also set TRX2L1 specific fields
+
# Generate a random burst
if self.burst_type == "NB":
-   buf = burst_gen.gen_nb()
+   burst = burst_gen.gen_nb()
elif self.burst_type == "FB":
-   buf = burst_gen.gen_fb()
+   burst = burst_gen.gen_fb()
elif self.burst_type == "SB":
-   buf = burst_gen.gen_sb()
+   burst = burst_gen.gen_sb()
elif self.burst_type == "AB":
-   buf = burst_gen.gen_ab()
+   burst = burst_gen.gen_ab()
 
-   print("[i] Sending %d/%d %s burst (fn=%u) to %s..."
+   # Convert to soft-bits in case of TRX -> L1 message
+   if self.conn_mode == "L1":
+   burst = msg.ubit2sbit(burst)
+
+   # Set burst
+   msg.burst = burst
+
+   print("[i] Sending %d/%d %s burst %s to %s..."
% (i + 1, self.burst_count, self.burst_type,
-   fn, self.conn_mode))
+   msg.desc_hdr(), self.conn_mode))
 
-   # Send to TRX or L1
-   if self.conn_mode == "TRX":
-   self.data_if.send_trx_msg(buf,
-   self.tn, fn, self.pwr)
-   elif self.conn_mode == "L1":
-   self.data_if.send_l1_msg(buf,
-   self.tn, fn, self.pwr)
-
-   # Increase frame number (for count > 1)
-   fn = (fn + 1) % GSM_HYPERFRAME
+   # Send message
+   self.data_if.send_msg(msg)
 
self.shutdown()
 
diff --git a/src/target/fake_trx/burst_send.py 
b/src/target/fake_trx/burst_send.py
index ee8e51a..4dbe984 100755
--- 

[PATCH] osmocom-bb[master]: trxcon/scheduler: reset lchan state after deactivation

2018-02-22 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6815

trxcon/scheduler: reset lchan state after deactivation

Let's assume that a logical channel, which was already in use,
is activated again for a new connection. As we don't reset the
state variables, such as burst masks or ciphering data, it may
cause an unexpected behaviour.

In order to avoid this, let's always reset the logical channel
state after deactivation.

Change-Id: I91e736a97cb05b167614cb488a00d847a9a859e0
---
M src/host/trxcon/sched_trx.c
1 file changed, 45 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/15/6815/1

diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 120098b..2142119 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -406,6 +406,42 @@
return 0;
 }
 
+static void sched_trx_reset_lchan(struct trx_lchan_state *lchan)
+{
+   /* Prevent NULL-pointer deference */
+   OSMO_ASSERT(lchan != NULL);
+
+   /* Reset internal state variables */
+   lchan->rx_burst_mask = 0x00;
+   lchan->tx_burst_mask = 0x00;
+   lchan->rx_first_fn = 0;
+
+   /* Free burst memory */
+   talloc_free(lchan->rx_bursts);
+   talloc_free(lchan->tx_bursts);
+
+   lchan->rx_bursts = NULL;
+   lchan->tx_bursts = NULL;
+
+   /* Forget the current prim */
+   sched_prim_drop(lchan);
+
+   /* TCH specific variables */
+   if (CHAN_IS_TCH(lchan->type)) {
+   lchan->dl_ongoing_facch = 0;
+   lchan->ul_ongoing_facch = 0;
+
+   lchan->rsl_cmode = 0x00;
+   lchan->tch_mode = 0x00;
+
+   /* Reset AMR state */
+   memset(>amr, 0x00, sizeof(lchan->amr));
+   }
+
+   /* Reset ciphering state */
+   memset(>a5, 0x00, sizeof(lchan->a5));
+}
+
 int sched_trx_deactivate_lchan(struct trx_ts *ts, enum trx_lchan_type chan)
 {
struct trx_lchan_state *lchan;
@@ -424,16 +460,10 @@
LOGP(DSCH, LOGL_DEBUG, "Deactivating lchan=%s "
"on ts=%d\n", trx_lchan_desc[chan].name, ts->index);
 
-   /* Free memory */
-   talloc_free(lchan->rx_bursts);
-   talloc_free(lchan->tx_bursts);
+   /* Reset internal state, free memory */
+   sched_trx_reset_lchan(lchan);
 
-   /* Reset ciphering state */
-   memset(>a5, 0x00, sizeof(lchan->a5));
-
-   /* Forget the current prim */
-   sched_prim_drop(lchan);
-
+   /* Update activation flag */
lchan->active = 0;
 
return 0;
@@ -451,12 +481,14 @@
for (i = 0; i < len; i++) {
lchan = ts->lchans + i;
 
-   talloc_free(lchan->rx_bursts);
-   talloc_free(lchan->tx_bursts);
+   /* Omit inactive channels */
+   if (!lchan->active)
+   continue;
 
-   /* Forget the current prim */
-   sched_prim_drop(lchan);
+   /* Reset internal state, free memory */
+   sched_trx_reset_lchan(lchan);
 
+   /* Update activation flag */
lchan->active = 0;
}
 }

-- 
To view, visit https://gerrit.osmocom.org/6815
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91e736a97cb05b167614cb488a00d847a9a859e0
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


<    1   2   3   4   >