Commit Graph

6620 Commits

Author SHA1 Message Date
Harald Welte 03d4583604 add (untested) TRAU frame decoder with support for FR/EFR and AMR 2009-01-05 19:01:01 +00:00
Harald Welte 509ddfa680 add (untested) 16kbit E1 sub-channel demux with TRAU frame sync 2009-01-05 19:00:01 +00:00
Holger Freyther a46c279ec5 Make gcc happy and remove a couple of warnings
Remove the callbacks from gsm_network for now. A set of different
callbacks will be back. E.g. when the paging is completed, when the
Q.931 like call handling is there...

Remove var's or move them into #if 0, remove unused stuff that looks
like we do not need it anytime soon or #if 0 them, move stuff around.
2009-01-04 21:05:01 +00:00
Holger Freyther 8e20c518f0 Be able to initiate paging from the telnet interface
The actual paging by subscriber needs to be implemented
2009-01-04 20:18:23 +00:00
Holger Freyther 312820339b Fix warning 2009-01-04 20:17:07 +00:00
Holger Freyther 856a3355d3 Export the gsm0411 alloc and send function 2009-01-04 20:16:25 +00:00
Holger Freyther ab63ed153f Some simple size check. We would not overflow but would send garbage
Check the size
2009-01-04 20:15:12 +00:00
Harald Welte c82b969a0b make use of new functions to print string chreq reason and lchan type 2009-01-04 16:54:12 +00:00
Harald Welte b7c334c080 use get_[lp]chan_name() functions for telnet interface 2009-01-04 16:11:31 +00:00
Harald Welte 6f0edaed77 functions to convert lchan/pchan type into human-readable string 2009-01-04 16:10:38 +00:00
Harald Welte d8c54063b1 Add some functions to CREATE OBJECTs in the BS-11 internal database 2009-01-04 12:02:08 +00:00
Holger Freyther 9f3c784a77 Implement sending custm GSM 04.08 commands
First you would page the IMSI and then send GSM 04.08
commands to the MS. This should help when testing new
commands
2009-01-04 03:57:27 +00:00
Holger Freyther bd2ec6c617 Make gsm48_sendmsg public as well 2009-01-04 03:55:31 +00:00
Holger Freyther bcc58e0b14 Make gsm48_msgb_alloc public and usable for the telnet_interface 2009-01-04 03:52:50 +00:00
Holger Freyther 19c3c73f35 Implement the call command...
Passing of an origin is missing this will need work in
gsm_04_08.
2009-01-04 03:50:40 +00:00
Holger Freyther b5419b764d Implement put_channel/get_channel, save on which bts we currently operate
Allow to change the refcount for a given channel. Store which
bts is our primary bts. A command to switch the primary bts will
be added as well. This makes entering and parsing of commands more
easy.
2009-01-04 03:49:41 +00:00
Holger Freyther 094eda239e Add implementation to find a lchan by the struct gsm_subscriber
Really compare pointers to check if the one gsm_subscriber
is equal to the other... gsm_subscriber should be unique for
a given IMSI so comparing the pointers should be fine.
2009-01-04 03:48:30 +00:00
Holger Freyther e46701ba3c Define the gsm_subscriber getter functions in the header 2009-01-04 03:47:05 +00:00
Holger Freyther a8573ee2cf Add a show command to list the channel allocation
Example output

show
BTS #0 on link 0  LOC: 1 TRX: 1 CCCH0: arfcn:123,#0
  TRX: 0 ARFCN: 123
     TS: #0 pchan: 2 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #1 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #2 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #3 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #4 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #5 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #6 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #7 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
2009-01-04 03:46:01 +00:00
Holger Freyther 6e30972221 Add test case that is not registering the timer again
yesterday's crash with the llist_del instead of using del_timer
was due this kind of bug. Add a test case.
2009-01-04 03:45:13 +00:00
Harald Welte 18f9f346ad define and use enum values for BS11 (or Siemens?) specific OML message types 2009-01-03 08:19:29 +00:00
Harald Welte 00f44a13e0 use NM_MT_* enum instead of hard-coded values 2009-01-03 08:16:25 +00:00
Holger Freyther acb3f20fbf Make wireshark happy.
Removing the P Bit from the fake LAPD frame will make wireshark
run the data through the GSM RSL dissector with the right SAPI
and LAPD preference setting.
2009-01-03 05:49:22 +00:00
Holger Freyther 262d711844 Clean up struct gsm_network and remove the gsm_subscriber 2009-01-03 05:48:32 +00:00
Harald Welte 94e46794fc Go through del_timer otherwise in_list will not be reset leading to crashes... 2009-01-03 04:39:51 +00:00
Harald Welte 7f22f11606 Readd the dummy lapd header... this gives valid TEI/SAPI information
Besides that the header is spoofed, we lose the information about
the channel (we will have to add our own encap type)
2009-01-03 03:28:10 +00:00
Harald Welte 2a1572966f Dump something that can be read by wireshark
We need to append the Linux LAPD header for wireshark. This means
that we currently can not support B Channels or such. Maybe we will
need to add another LAPD header.
2009-01-03 03:04:07 +00:00
Harald Welte eb5518abea Use the right network/link type, prepend the vISDN header...
Now only the LAPD header is invalid...
2009-01-03 01:32:00 +00:00
Harald Welte 5f9b229b53 Write the pcap packet header first :) 2009-01-03 00:41:04 +00:00
Harald Welte 060c2424e3 Add new management function to struct timer_list
Make sure that del_timer succeeds and removes an entry from the list. Currently
sending the LOCATION UPDATING REJECT from within the timer will not remove the
list element as ->active gets set to 0 in the timer updating before calling the
callback. Fix the segfault and allow the timer to be removed from within its
own callback.
2009-01-02 23:57:22 +00:00
Holger Freyther 9b16cf3efd Add simplistic telnet control interface
This might turn into a complete wire protocol with special
client software. For now it will be a simple client interface
that you can use with telnet to do certain things.

This is using flex to implement the parsing. Implementation
and more commands will follow.
2009-01-02 22:04:43 +00:00
Holger Freyther 39df725e36 Use the _safe variant as a bsc_unregister_fd might be called from within the callback 2009-01-02 21:53:34 +00:00
Holger Freyther c7a2d781fc Fix make distcheck by adding some header files 2009-01-02 02:00:35 +00:00
Holger Freyther cd43fc53b2 Write only actual data into the pcap file
The current LAPD control field for indication/disconnect/etc
is wrong and currently we are only interested in the actual
A-Bis data spoken between the BTS and BSC and not on the indication
of the physical line (connection, disconnect, release..)
2009-01-02 01:18:28 +00:00
Holger Freyther c8f3f0c423 Attempt to put the time into the pcap packet record 2009-01-02 01:17:48 +00:00
Holger Freyther caae86791f Add the option to write the communication on the D Channel to a pcap file
When using ISDN as network type and using a fake LAPD encapsulation
wireshark should be able to recognize some bits if dump.

Append a dummy LAPD header. It is not clear to me if the Control field
of the LAPD frame is part of the msg or if we need to add it as well.

TODO:
    - Do the same for the B Channel
    - Write out time
    - Check if more of the LAPD frame needs to be prepended. The
      information from the mISDNhead comes into mind. Maybe it makes
      sense to start a custom wireshark mISDN dissector.
2009-01-02 00:40:15 +00:00
Holger Freyther 38a23ac13c Document where to find the how to determine the paging group
Point to the right location in the pile of spec
2009-01-01 18:02:29 +00:00
Holger Freyther aa82f0dea2 Change the subscriber and database backend
gsm_subscriber is now refcounted, the db backend is leaking
a lot less, db_get_subscriber will allocate the subscr record
now, subscr_* will look up a subscriber in the list of currently
active subscribers and add an ref to this one.

The db test cases pass, more testing will be when next to the bts
2009-01-01 18:02:05 +00:00
Holger Freyther c07e90d01c Do not call rsl_chan_release directly but use the use_count of the lchan
Call use_lchan early in allocate_loc_updating_req, do not directly call
rsl_chan_release but go through channel alloc to take the use_count into
account.
2009-01-01 03:46:11 +00:00
Holger Freyther bdde910386 Speculative fix for not sending LOCATION UPDATING REJECT
As reported by the operator the rejecting didn't work after the
first fix (wrong logic/missing negation). The hypothesis is that
that the lchan was released before the reject timeout was fired.

Fix it by getting a reference on the lchan when allocating a
logical operation and release the reference when the operation
is finished or timed out.
2009-01-01 02:59:03 +00:00
Harald Welte 3439b3c678 add signal handlers for clean shutdown of BTS via OML on shutdown of program 2009-01-01 01:50:32 +00:00
Harald Welte 1987554faf get rid of some more gcc warnings 2009-01-01 00:33:37 +00:00
Harald Welte f991e1a496 get rid of gcc warnings about function prototype 2009-01-01 00:33:20 +00:00
Harald Welte 0cfe9ee6bd add missing string.h include 2009-01-01 00:33:02 +00:00
Harald Welte 1844d68a5d don't return a value in a void function 2009-01-01 00:32:49 +00:00
Harald Welte 5828a034ec * fix check for null-pointer in release_loc_updating_req()
* fix endianness of operator name
2008-12-31 23:59:18 +00:00
Holger Freyther c1e1192c2e Move the db_test.c to a specific test directory 2008-12-31 23:25:05 +00:00
Holger Freyther c5851c96b3 Make the test compile again 2008-12-31 23:24:37 +00:00
Holger Freyther 3b0599cb21 Introduce logical updating request operation on the gsm_lchan
We are going to have logical operations like Phone Call, SMS,
Paging, Updating Request on a logical channel and for each of
these operations we might need to store state. For now pointers
in gsm_lchan look like the best way of doing this and we start
by introducing an operation for the location updating request.

The new flow of things are:
    - We get the location updating request and update/create
      the subscriber and maybe send the identity requests to
      the mobile station
    - We start the updating timer, if it times out we will
      reject the mobile station.
    - Once we get the Identity Responses we have asked for
      and the reject timer did not fire yet we might accept
      the user.
2008-12-31 18:53:57 +00:00
Holger Freyther a157df1951 We have freed the channel there is no subscriber associated anymore
FIXME: Introduce refcounting on the subscriber record. This looks like
a genuine memory leak to me.
2008-12-31 18:52:54 +00:00