Commit Graph

1436 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther e1d5067789 [sccp] Implement parsing the rather easy IT messages. 2010-02-26 19:26:35 +01:00
Holger Hans Peter Freyther e2c5028dc4 [sccp] Use msgb->l2h instead of msgb->data for CR
Using msgb->data only works as long as msgb->data == msgb->l2h.. In
the case of receiving a MSU unit from a E1 link, or even receiving
the IPA header we will have some non SCCP data at msgb->data and then
cast garbage to what we think is making sense..
Use msgb->l2h and everything is fine.
2010-02-20 00:36:03 +01:00
Holger Hans Peter Freyther b2abbe8a93 [sccp] Make the bitfields work on big endian machines too
* Use the endian.h to fogure out for which endianess we are
  building and then use the bitfields in reverse order
2010-02-14 19:27:16 +01:00
Holger Hans Peter Freyther 8fabf514ef [sccp] Set the data_len when parsing UDT messages as well
For UDT the msgb_l3len can be safely used but it is better
to set it to data_len for everyone..
2010-02-12 23:08:21 +01:00
Holger Hans Peter Freyther 3cb2890e56 [sccp] Slightly improve the log message 2010-02-03 18:19:05 +01:00
Holger Hans Peter Freyther 6ae657228c [sccp] Refer to the right Company in the Copyright/Copyleft line
Use On-Waves instead of the name I made up from the domain name.
2010-02-03 18:17:49 +01:00
Holger Hans Peter Freyther 67f5003caa Merge branch 'master' into on-waves/sccp 2010-02-03 18:15:05 +01:00
Holger Hans Peter Freyther 9377528c70 Merge branch 'on-waves/mgcp' 2010-02-03 18:11:22 +01:00
Holger Hans Peter Freyther 92026f1cef [mgcp] Refer to the right Company in the Copyright/Copyleft line
Use On-Waves instead of the name I made up from the domain name.
2010-02-03 18:10:07 +01:00
Holger Hans Peter Freyther 62e836c533 [mgcp] Make the mgcp_protocol generate a struct msgb*
Do not directly send data from inside the mgcp_protocol.c
implementation. Instead allocate and return a struct msgb*. The
caller can then either wrap that into the IPA protcol or directly
send it over the UDP socket.
2010-02-03 11:03:45 +01:00
Holger Hans Peter Freyther 77f7afe08e [mgcp] Prepare the in process MGCP handling by adding callbacks
* Call a callback when the endpoint was created, modified or deleted. This
  can be used by the BSC MUX to send a MGCP packet over TCP to the right
  the BSC to allocate the endpoint there with the right data, or it can be
  used in the BSC to send the right commands to the BTS.
2010-02-03 09:54:43 +01:00
Holger Hans Peter Freyther 2ada71de64 [mgcp] Replace DEBUGP with the LOGP statement
* Classify messages as LOGL_INFO or LOGL_ERROR
2010-02-03 09:13:10 +01:00
Holger Hans Peter Freyther e0955029a1 [mgcp] Prepare to do MGCP over TCP and inside the bsc_msc_ip process
* Separate main process and protocol handling into two parts.
* Change the protocol handling to work with UDP and TCP connection
* This will allow to speak MGCP over TCP between the BSC MUX and
  the real BSC.
2010-02-03 08:50:33 +01:00
Holger Hans Peter Freyther 89f3cb8606 [mgcp] Rename the source to mgcp_main.c 2010-02-02 12:07:21 +01:00
Holger Hans Peter Freyther a18445d262 [mgcp] Move the MGCP procoess into a sub directory 2010-02-01 14:00:07 +01:00
Holger Hans Peter Freyther e01ee97cd3 [mgcp] In forward mode we need to rediscover the BTS more often
In plain forward mode we don't have DLCX which will clean
and reset the configuration. We will need to remember the
last GSM BTS port and send data to it.
2010-02-01 13:17:04 +01:00
Holger Hans Peter Freyther 9100e1dea4 [mgcp] Handle BTS and NET being on the same host
* Do not only check the IP but also the port to figure out
  where to send the data
* Do not memset the endp->remote inside the bind_rtp but from
  inside the crcx as this will be modified by the MDCX
2010-02-01 13:16:53 +01:00
Holger Hans Peter Freyther 9b28fc8be2 [mgcp] Warn about unknown messages... 2010-02-01 13:16:44 +01:00
Holger Hans Peter Freyther bd5130d3c1 [mgcp] Allow to forward to a different port 2010-02-01 13:13:31 +01:00
Holger Hans Peter Freyther 6c79646089 [mgcp] Rename rtp and rtcp variables to net_rtp and net_rtcp
Rename the variables to refer to the fact that they are
the ports of the remote.

So we have:
    rtp_port as the local address we are binding to
    net_rtp  for the network rtp
    bsc_rtp  for the bsc rtp
2010-02-01 13:13:21 +01:00
Holger Hans Peter Freyther 601a67e274 [mgcp] Make it possible to not specify a bts ip
This way the mgcp will allow anyone to be the BTS..
in the future we might need to communicate things
properly between BSC and MGCP.
2010-02-01 13:13:11 +01:00
Holger Hans Peter Freyther caf49b4c14 [sccp] Implement sccp_parse_header to be used by the NAT code. 2010-01-29 04:36:48 +01:00
Holger Hans Peter Freyther ef84539fb7 [sccp] Split Connection DT1 into two parts
This is the last of supported messages to be split into a parse
and handle routine. Now all parse routines can be used by the NAT.
2010-01-29 04:36:38 +01:00
Holger Hans Peter Freyther 18c5cadc46 [sccp] Split Connection Release Complete into two parts 2010-01-29 04:36:29 +01:00
Holger Hans Peter Freyther ca1d1d1493 [sccp] Split Connection Confirm handling into two parts 2010-01-29 04:36:20 +01:00
Holger Hans Peter Freyther fe5de4e524 [sccp] Split Connection Refused into two parts 2010-01-29 04:36:12 +01:00
Holger Hans Peter Freyther 88fe6eec76 [sccp] Split Connection Released into two parts
Split the Connection Released into header parsing and into
acting on the parsed result. This is part of the NAT work.
2010-01-29 04:36:03 +01:00
Holger Hans Peter Freyther a8cd2e6b0e [sccp] Separate connection parsing and policy for connection request
The same concept as with the previous patch, make the reject method
work on the source local reference instead of passing it the header.
2010-01-29 04:35:50 +01:00
Holger Hans Peter Freyther efca5419b7 [sccp] Move the UDT parsing to a new method
Separate SCCP UDT parsing and handling into two methods. This
way the parsing can be reused by the BSC NAT.
2010-01-29 04:35:42 +01:00
Holger Hans Peter Freyther 82da7fcf62 [sccp] Invent new API to be used by the BSC NAT
I want to reuse the SCCP code for header parsing in the BSC
NAT to identify data and patch the source local reference. To do
this the current handle_* methods will be changed into two parts
one is strictly parsing the other is handling the parsed data.
2010-01-29 04:35:34 +01:00
Holger Hans Peter Freyther a692fbcff5 [sccp] Add a utility for the nat..
Add a small helper to determine the type of a message
2010-01-29 04:35:18 +01:00
Holger Hans Peter Freyther 1b891fd7ba [gsm48] Use optional Chan Mode 1 for the assignment command
Specify how we intend to use the assigned channel. This is
needed to make CC with early assignment work properly.
2010-01-28 12:46:04 +01:00
Holger Hans Peter Freyther 550197fd8c [gsm48] Allow to send the assignment command on a different lchan
Change the signature to take the lchan were the message is supposed
to be sent and the lchan which is supposed to be assigned.
2010-01-28 12:45:57 +01:00
Holger Hans Peter Freyther 93b6c6555c [rsl] Send the MultiRateConfig in the RSL Channel Activate msg
If the lchan has AMR as speech codec we also need to send the
multirate config IE in the channel activation. This is already
done for the RSL Channel Modify message.
2010-01-28 10:23:34 +01:00
Andreas Eversberg 1e1c6aa5a3 Make sure select() callbacks are not called multiple times
the unix select function returns a set of file descriptors to be
handled. the result-loop (the loop after the select()) is called again,
if more than one descriptor is removed by the callback funtion. this may
lead to a another call to the callback function, because the bits of the
FD_SETs do not change and still set.

i think we must clear these bits, if they are handled, so the handler
will not be called twice in case of a "restart" of that loop.
2010-01-23 10:52:38 +01:00
Daniel Willmann 604d851b89 Register GSM_BTS_TYPE_UNKNOWN in bsc_hack.c
The way the VTY configuration sytem works is that it first registers a
BTS of type GSM_BTS_TYPE_UNKNOWN and then sets the type correctly (after
encountering the type statement). This makes sure that registering a BTS
of type UNKNOWN succeeds.
2010-01-14 21:52:34 +01:00
Daniel Willmann f15c276382 [vty_interface.c]: Warn if no BTS could be allocated 2010-01-14 21:52:26 +01:00
Harald Welte 0677061757 update copyright statements
* include 2010
* add Andreas Eversberg and Sylvain
2010-01-12 10:46:27 +01:00
Harald Welte 714e1a29cc Merge remote branch 'goeller/master' 2010-01-12 10:46:03 +01:00
laforge 6af56d1501 Fix allocation of BTS from VTY
In 39315c4798 we introduced
per-bts OML attribute parser definitions and disallowed
a BTS of type unknown.

However, the VTY code first allocates a BTS with unknown type.
2010-01-12 10:46:27 +01:00
Holger Hans Peter Freyther ca8dc141eb Merge branch 'on-waves/mgcp' 2010-01-11 17:10:19 +01:00
Holger Hans Peter Freyther 620961983c [bsc_mgcp] Set the right remote rtp and rtcp port
* It is the same as local endpoint port
2010-01-11 16:58:08 +01:00
Holger Hans Peter Freyther 2c492ed276 [bsc_mgcp] Fix writing of the config file...
* Add the new forward audio option
2010-01-11 16:57:58 +01:00
Holger Hans Peter Freyther f986cfc508 [bsc_mgcp] Print a message which mode is configured 2010-01-11 16:57:51 +01:00
Holger Hans Peter Freyther 14083bef0f [bsc_mgcp] Add a new forward only mode to the bsc_mgcp
With forward IP in the config and early bind on we will
simply forward RTP data on the endpoints from BTS to the
forward IP address.

This is implemented by disabling MGCP functionality when
a forward IP address was specified, setting the forward IP
in the endp->remote and assigning a ci != CI_UNUSED.

Early bind will make sure the sockets are created, the BSC FD's
are registered and then the normal dispatch code will
do the forwarding.
2010-01-11 16:57:40 +01:00
Holger Hans Peter Freyther 98657d5dee misc: Fix compilation of the test cases. 2010-01-11 16:42:07 +01:00
Harald Welte a855d1f846 fix ipaccess-config, call missing nanobts initialization
FIXME: We really need to have some libbsc and libmsc initialization
functions that clean up this mess.
2010-01-10 18:37:38 +01:00
Harald Welte 202259c31e add sylvain and andreas as authors 2010-01-10 18:21:33 +01:00
Harald Welte 39315c4798 [OML] parse attributes depending on BTS type
Some NM attributes are defined differently depending on
the BTS type.  Having one big nm_att_tlvdef[] table for
all BTS types is no longer sufficient.  This patch

* introduces 'struct gsm_bts_model' to describe a BTS model
* adds definitions of gsm_bts_model for BS-11 and nanoBTS
* changes the abis_nm_tlv_parse() function: include a bts pointer
2010-01-10 18:01:52 +01:00
Harald Welte 5078148829 TLV: add function to patch a tlv definition table 2010-01-10 17:45:23 +01:00