Commit Graph

563 Commits

Author SHA1 Message Date
Holger Freyther 3e2c32322e Make gsm48_sendmsg public as well 2009-01-04 03:55:31 +00:00
Holger Freyther 819dd205a9 Make gsm48_msgb_alloc public and usable for the telnet_interface 2009-01-04 03:52:50 +00:00
Holger Freyther f87573dc4e 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 d0e38c3cad 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 a471a41680 Define the gsm_subscriber getter functions in the header 2009-01-04 03:47:05 +00:00
Harald Welte 4668fdaa26 define and use enum values for BS11 (or Siemens?) specific OML message types 2009-01-03 08:19:29 +00:00
Holger Freyther 460af8b794 Clean up struct gsm_network and remove the gsm_subscriber 2009-01-03 05:48:32 +00:00
Harald Welte b8f04ea5a9 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 219518d064 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 b21b305d7c Fix make distcheck by adding some header files 2009-01-02 02:00:35 +00:00
Holger Freyther 9a3ee0ff1b 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 12aa50d5a2 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 67b4b9a017 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 73487a23da 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 e97f7fba97 Add an option to set the global reject cause
This will need to be moved into bsc_hack.c together with the
policy to accept/reject a UPDATING LOCATION REQUEST.
2008-12-31 18:52:11 +00:00
Holger Freyther c6ea9dbeba Recylce a gsm_lchan when the refcount drops to zero
When a channel is allocated, start a timeout, when a lchan_use
is used the timer will be restarted, when the timeout fires
we will try to recycle or restart the timer.
2008-12-30 19:18:21 +00:00
Holger Freyther 590d66acec Fix the reference. The names and values are described in 9.1 of 04.08 2008-12-30 19:13:13 +00:00
Harald Welte c6ba9c2a97 * 04:08: add MM INFO information elements
* gsm_data: add network name to gsm_network
2008-12-30 18:01:02 +00:00
Holger Freyther 89824fc466 Add an option to allow everyone to the network.
This should move out of gsm_04_08 and the accept, reject
policy should be controllable by the higher levels.
2008-12-30 16:18:18 +00:00
Holger Freyther a767794d96 [gsm0408] Add enum values for the LOCATION UPDATING REJECT cause
Convert spec to the enum
2008-12-30 16:18:16 +00:00
Harald Welte b0f4793f90 export debug_flags 2008-12-30 14:59:01 +00:00
Holger Freyther b7193e4e94 Introduce new callbacks, remember that we have LOC UPD REQ, reject things only once
gsm_data.h add new callbacks, add some parameters, update bsc_hack and
other call sites.

Remember that we need to ACCEPT/REJECT the LOCATION UPDATE REQUEST and
then send the ACCEPT or schedule the sending of the reject. Currently
it is possible that for a new subscriber that we do not have a !subscbr
yet, we will trigger an IDENTITY REQUEST and schedule the reject timer.
This may lead to rejecting AND accepting (a new subscriber). This issue
is triggered when allowing everyone to connect to the network.
2008-12-29 17:44:08 +00:00
Holger Freyther 2eafef599c Up on call released release the channel and take the next item
Once a call is released, release the gsm_lchan and move to the
next item in pending_stations or wait for more work.
2008-12-29 06:42:17 +00:00
Holger Freyther abade7af88 Initiate a call once we have a channel assigned 2008-12-29 06:42:15 +00:00
Holger Freyther 88ea832ed7 Unite the acked/nacked handling in a common response... 2008-12-29 06:23:52 +00:00
Holger Freyther 24893de3cb Inform the bsc about acked or nacked channels...
On channel allocation the bsc_hack added a cookie to the lchan on
ack and nack we will take a look and then assume it is the channel
we have allocated. This can be easily exploited by a MS sending fake
responses to paging commands. After the channel has been acked we would
have to ask for the tmsi or find the information on the channel
allocation. For now we will guess.
2008-12-29 06:23:51 +00:00
Holger Freyther 3186bf209a Add callback for allocated lchannels
Currently it is not possible to know for which tmsi the channel
is going to be allocated. The bsc_hack will guess.. in the future
it might be forced to ask for the tmsi after the channel has been
opened...
2008-12-29 06:23:49 +00:00
Holger Freyther 07cc8d8bee Improve page command handling in the bsc_hack
Add a callback to the gsm_network. When updating the location and
assigning a new tmsi callback into the bsc_hack.c and have a queue
of mobile stations to page, allocate a channel for and ultimately
dial.
2008-12-29 06:23:46 +00:00
Daniel Willmann 6fe997e9dd Implement sending SMS and send one on network registration 2008-12-29 04:20:41 +00:00
Harald Welte e14a57cc0e Create request channel reason to see channel requests originating from PAG 2008-12-29 04:08:28 +00:00
Harald Welte d35b6a7b12 debug: Create a region for Paging Command 2008-12-29 04:06:41 +00:00
Harald Welte de9226de16 Split out rach_control, missing mask from the last commit 2008-12-29 02:37:23 +00:00
Daniel Willmann 471712b133 ACK sms-submit 2008-12-29 01:54:02 +00:00
Daniel Willmann e0fbec823b Parse sms-submit messages 2008-12-29 00:44:41 +00:00
Harald Welte b84e2f4f1b * use 16bit for network and country code
* use aligned attribute for more data structures
* add command line arguments for operator/country code
2008-12-28 23:42:04 +00:00
Holger Freyther bde361064a make it optional where the hlr database is stored
Add --database to define where the database is stored. The default
was changed to not store the file in /tmp anymore.
2008-12-28 22:51:39 +00:00
Holger Freyther 177466199f [gsm0408] Make the generate_lai usable by other code
Prefix generate_lai with gsm0408 and update call sites. It will
be used from within bsc_hack.c
2008-12-28 16:32:44 +00:00
Holger Freyther 1ad732c699 [debug.h] Introduce a static assert using the array with negative size trick
It is inspired by the COMPILE_ASSERT from WebKit and is using the well
known trick to get compile time assertions.
2008-12-28 16:32:41 +00:00
Holger Freyther 5e85c8ea40 [gsm_04_08] Add structs for system information type 1 to 6
system information type 4 is a bit tricky as it has
a variable length and is terminated by a manadantory field.

System Information Type 6 has a mandantory SI 6 Reset Octet
but our BTS is happy with not receiving it. Make it optional
by the adding a 'pointer'.

System Information Type 5 and System Information Type 6 are
send through rsl_sacch_filling and it looks like we do not
need to send the L2 pseudo length. So far we have not found
the documentation confirming this. This is why the header
from Type 1 to Type 4 is not used.
2008-12-28 16:32:39 +00:00
Harald Welte 255539c742 working state up to location update and classmark inquiry 2008-12-28 02:26:27 +00:00
Daniel Willmann fdd0a6c157 Add SMS (GSM 04.11) testing program 2008-12-28 01:51:14 +00:00
Daniel Willmann 8b3390effd Start implementing GSM 04.11 (short message service) 2008-12-28 00:31:09 +00:00
Stefan Schmidt 4d4661d65b Draft ideas for high level call handling 2008-12-27 22:59:48 +00:00
Jan Luebbe 391d86e0d5 add extension field to subscriber struct and name column to db 2008-12-27 22:33:34 +00:00
Harald Welte bcae43fe1b SMS stub 2008-12-27 21:45:37 +00:00
Jan Luebbe fac25fccbd add a equipment table 2008-12-27 18:04:34 +00:00
Harald Welte a3d0438ff7 missing header file changes 2008-12-27 17:02:56 +00:00
Jan Luebbe 6e2e545fa1 add authorized state to subscribers in db 2008-12-27 16:47:55 +00:00
Jan Luebbe 5c15c85be3 rewrite db backend 2008-12-27 15:59:25 +00:00
Holger Freyther b332f61f0d Use getopt in the bsc_hack to parse options
Current options include a draft of the help screen, an option
to disable the colors and to specify the debug categories to
show.
2008-12-27 12:46:51 +00:00
Holger Freyther 5ee72eeeb1 Prefix debug symbols with debug_ to reduce the namesapce pollution 2008-12-27 12:46:49 +00:00
Holger Freyther d546e31628 Add code to parse a debug category string
Use strdup to be able to use strtok on the category string and add
a test case. Also safe some more information to be able to use color
in the print statement.
2008-12-27 12:03:07 +00:00
Holger Freyther 5f75598c28 Introduce a simple timer API....
One can use add_timer or schedule_timer to add a timer. After
the timeout time has been reached the callback will be called.
One can call add_time/schedule_timer and del_timer from within
the callback.
2008-12-27 09:42:59 +00:00
Holger Freyther 5677ae35ba misdn.h forward declare mi_setup 2008-12-27 09:41:03 +00:00
Harald Welte 4b634544e6 now we get up to the SETUP of MO calls 2008-12-27 01:55:51 +00:00
Jan Luebbe faaa49ca51 db: add GPL headers and integrate with autofoo 2008-12-27 01:07:07 +00:00
Harald Welte 5b6cfaf933 mISDN header files 2008-12-27 00:51:07 +00:00
Harald Welte 702d8707a9 working state up to location update and classmark inquiry 2008-12-26 20:25:35 +00:00
Harald Welte ad38464728 this is the first version that actually talks to the BTS
* initialize OML and RSL based on TEI establish (ACTIVATE_IND) events
* fix abis_nm_raw_msg() to not overwrite the OML header with payload
* fix debug print statements
* fix msgb_dequeue: actually dequeue it from the list ;)
2008-12-26 10:20:07 +00:00
Harald Welte 3633a6daf9 * fix DEBUGP defines, activate DEBUG functionality
* fix typo in db_transmission function
2008-12-26 00:06:02 +00:00
Harald Welte 8470bf200d no reasonable commit message possible. tons of changes of the last 2 days 2008-12-25 23:28:35 +00:00
Harald Welte de729a139e autoconf 2008-12-23 21:01:25 +00:00
Harald Welte 52b1f98889 initial commit of current OpenBSC state 2008-12-23 20:25:15 +00:00