Commit Graph

210 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 2bf19da405 m2ua: Allow to set a log area for DM2UA. 2011-01-22 22:59:39 +01:00
Holger Hans Peter Freyther ecfd1d97c6 m2ua: Fix the padding calculation
This was found in interop testing. We have to add number of
bytes to fill up four that are not provided by the payload
but nothing if the rest is zero.
2011-01-18 17:38:14 +01:00
Holger Hans Peter Freyther 518780c203 m2ua: Okay... get the order of the arguments right 2011-01-14 19:47:44 +01:00
Holger Hans Peter Freyther 5dd47222d2 m2ua: Attempt to use a memcpy... maybe this is fixing a segfault
This is a bit of exploring why this could fail...
2011-01-14 19:21:01 +01:00
Holger Hans Peter Freyther aa914ef127 m2ua: Pad the data properly, read over the padding properly 2011-01-14 18:33:44 +01:00
Holger Hans Peter Freyther 9566027b07 m2ua: Implement to find a tag inside a message 2011-01-13 13:53:26 +01:00
Holger Hans Peter Freyther f3b7effbc1 m2ua: Add parsing and creation of m2ua packages 2011-01-12 12:50:09 +01:00
Holger Hans Peter Freyther c7ba0e5018 mtp: Remove the mtp_data header file as it refers to the cellmgr 2011-01-12 12:49:55 +01:00
Holger Hans Peter Freyther 039c7adcd5 sccp: Add a test case for GTI creation, set the SSN indicator bit
Make sure that creating an address that should be routed based on
the GTI can be created properly.
2010-11-26 18:17:28 +01:00
Holger Hans Peter Freyther 6ecf8104c0 sccp: Use the length of the address to update the offsets
Instead of guessing the length of an address, use the result
of the sccp_create_addr method.
2010-11-16 20:56:08 +01:00
Holger Hans Peter Freyther 13cd1199b9 sccp: Rewrite the sccp_test_addr to set the size correctly
Fix the code to set the number of consumed bytes correctly
and return the number of bytes consumed for for the address.

Add a simple but expandable test case to test the SCCP address
2010-11-16 20:56:08 +01:00
Holger Hans Peter Freyther ec5409ca4f sccp: Make the sccp_create_addr function public
Prefix it with sccp_ and remove the static. This way we
can test this from the unit tests.
2010-11-16 20:56:08 +01:00
Holger Hans Peter Freyther 27cdccf74a sccp: Pass the sccp_connection down to the send method if it exists
This allows to identify the sccp connection and send the SCCP
payload down to a different stream depending on the connection. It
will be used by the bsc_msc_ip to keep multiple MSC connections
open.
2010-08-25 12:01:12 +08:00
Holger Hans Peter Freyther 3e021b827f sccp.c: Make the create work with data + len to not have a msgb 2010-08-02 23:01:02 +08:00
Holger Hans Peter Freyther b5a2f8d589 sccp: We have the gti_ind inside the address already. 2010-08-02 22:00:28 +08:00
Holger Hans Peter Freyther d2a7174414 sccp: Allow to create a _udt message with the given parameter. 2010-08-01 20:52:01 +08:00
Holger Hans Peter Freyther 8c1402ea99 sccp: Use the function to put the sccp address.. fixes GTI for connect 2010-08-01 20:47:39 +08:00
Holger Hans Peter Freyther 00e6f692e9 mtp: Add the MTP Level3 code to the SCCP repoistory
SCCP can be wrapped inside the MTP Level3, and one can
use it for link testing as well. This repository should
be renamed to libosmo-itu or libosmo-ss7 and be a host
to SS7 related encapsulation...

The code is coming from the cellmgr-ng code.
2010-08-01 17:01:26 +08:00
Holger Hans Peter Freyther 68b7e8bd60 sccp: Rename the SCCP file and delete the sccp/ directory.. 2010-08-01 05:30:55 +08:00
Holger Hans Peter Freyther cee698ac9a sccp: Remove SCCP address check, routing is a different topic..
We do not do any routing right now... we will accept everything
right now and that appears to be fine.
2010-08-01 04:57:41 +08:00
Holger Hans Peter Freyther 6b4c9f194f sccp: Allow to have more data in the buffer than wanted by UDT.. 2010-08-01 04:57:41 +08:00
Holger Hans Peter Freyther 7360a36ead sccp: Copy out pointers to the GTI into the parsed structure.. 2010-08-01 04:57:41 +08:00
Holger Hans Peter Freyther 9aa8c8bb35 sccp: Make it possible to have a POC inside the sockaddr_sccp.
Embed the POC, add the indicator, add the POC byte.
2010-08-01 04:57:41 +08:00
Holger Hans Peter Freyther 444d8d1234 sccp: Make it possible to put a GlobalTitle into the SCCP header. 2010-08-01 04:57:40 +08:00
Holger Hans Peter Freyther 17097d06b5 sccp: Add a new buildsystem for the OSMO SCCP library 2010-07-30 02:13:37 +08:00
Holger Hans Peter Freyther e4cb3e039b sccp: Adjust the code to only depend on libosmocore
* Introduce a method to set the value of the debug area to
  use and default it to -1. Turn the DSCCP enum into a local
  variable to make the log messages work.
* Remove usage of openbsc and libbsc.a
2010-07-30 02:12:02 +08:00
Holger Hans Peter Freyther e3c0d8bbf3 sccp: u_int32_t -> uint32_t 2010-07-23 18:40:10 +08:00
Holger Hans Peter Freyther be76a717e0 sccp: u_int16_t -> uint16_t 2010-07-23 18:39:39 +08:00
Holger Hans Peter Freyther acd31a3ac4 sccp: u_int8_t -> uint8_t 2010-07-23 18:39:17 +08:00
Holger Hans Peter Freyther 4da58e06ca [sccp] Add method to create a dt1 packet. 2010-05-17 04:08:57 +08:00
Holger Hans Peter Freyther 29c30a0c15 [sccp] Create a method to create RLSD messages. 2010-05-17 04:08:50 +08:00
Holger Hans Peter Freyther 72bec50b8e [sccp] Create a SCCP CC creation routine. 2010-05-17 04:08:42 +08:00
Holger Hans Peter Freyther 38cc0e6c4d [sccp] Make it optional to send data on a SCCP Connection Refuse
This can be used to send a Location Updating Reject down to the
BSC when it is clear that a subscriber is not allowed.
2010-05-15 05:35:48 +08:00
Holger Hans Peter Freyther bfa3c776af [sccp] Export function to create SCCP Refuse message. 2010-05-15 05:35:20 +08:00
Holger Hans Peter Freyther a35712a940 [sccp] Move from DEBUGP to LOGP in sccp.c 2010-04-25 23:05:00 +08:00
Holger Hans Peter Freyther c459c0491a [sccp] Parse the error message and add a unit test for it. 2010-04-25 23:04:38 +08:00
Holger Hans Peter Freyther 902e32e051 [sccp] Add a force_free method for connections
E.g. when the underlying connection transport medium is gone
one needs to force to close SCCP connections, add this helper.

It will remove the connection from the list of connections and
it will free the data.
2010-04-05 22:00:24 +02:00
Holger Hans Peter Freyther a9e39c3264 sccp: Change the ownership of the msgb passed to the callback
Instead of deleting the msgb within the SCCP library the implementor
of the write callback needs to free it. This is required for non
blocking io with the server.
2010-03-26 05:44:21 +01:00
Holger Hans Peter Freyther be49ea0601 Merge remote branch 'origin/master' into on-waves/sccp 2010-02-26 20:18:24 +01:00
Holger Hans Peter Freyther d8879f86ae [sccp] Implement parsing the rather easy IT messages. 2010-02-26 19:26:35 +01:00
Harald Welte 88d982b48c split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB

The library currently includes the following modules:

bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist

msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 16:27:23 +01:00
Holger Hans Peter Freyther dc095c5934 Merge branch 'on-waves/sccp' 2010-02-20 00:38:20 +01:00
Holger Hans Peter Freyther 2b68a7393d [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 dcf5d78525 Merge branch 'on-waves/sccp' 2010-02-14 19:27:52 +01:00
Holger Hans Peter Freyther 85a95763b7 [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 756aaadf5b Merge branch 'on-waves/sccp' 2010-02-12 22:52:12 +01:00
Holger Hans Peter Freyther 63cd135faa [sccp] Make the file includable outside of OpenBSC 2010-02-12 22:51:24 +01:00
Holger Hans Peter Freyther 0fe7385ba1 [sccp] Slightly improve the log message 2010-02-03 18:19:05 +01:00
Holger Hans Peter Freyther 90d7490a24 [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 08c87e064a [sccp] Implement sccp_parse_header to be used by the NAT code. 2010-01-29 04:36:48 +01:00
Holger Hans Peter Freyther cc9dda075f [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 f88fd6d19b [sccp] Split Connection Release Complete into two parts 2010-01-29 04:36:29 +01:00
Holger Hans Peter Freyther 84a3b9c9ff [sccp] Split Connection Confirm handling into two parts 2010-01-29 04:36:20 +01:00
Holger Hans Peter Freyther 16c5b6fb17 [sccp] Split Connection Refused into two parts 2010-01-29 04:36:12 +01:00
Holger Hans Peter Freyther b91490b6b8 [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 43c1c84341 [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 2f8c70e0b3 [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 762afe424d [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 2ac75aeb4d [sccp] Implement sending the Inactivity Test on a connection..
Currently this will send a dummy inactivity test message,
there is currently no parsing or API to receive the messages.

The sequencing and credit entries are empty as sequencing
is currently not used at all.

The test is currently limited to send the message and see
if the application is crashing or not.
2009-11-20 13:09:15 +01:00
Holger Hans Peter Freyther 8bfd8d1648 [sccp] Implement parts of ITU SCCP for use in the A-Interface
include/sccp/sccp_types.h contain Q.713 and GSM definitions
include/sccp/sccp.h is the application interface resembling
                    the esentials of the UNIX socket interface.

src/sccp.c is the actual implementation of SCCP featuring
           connection and UDT1 support.

tests/sccp/sccp.c is testing connection creation and formating
                  of the SCCP messages used by the A-interface. And
                  it contains a simple fuzzing test to test the
                  robustnes of the implementation.
2009-11-20 13:09:15 +01:00