aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/ipaccess
AgeCommit message (Collapse)AuthorFilesLines
2016-12-21build: remove obsolete $LIBCRYPT in two placesNeels Hofmeyr1-1/+0
It should be $LIBCRYPTO_LIBS if at all. Change-Id: I191dfe0901a10a25dffa3bbfdb9ea319fcebe254
2016-12-20Fix some typos in stdout outputRuben Undheim1-2/+2
Change-Id: I0dbb438f3bfbaf9744717cbeec31ceefdd679ee9 Related: OS#1694
2016-12-09abisip-find: check bsc_fd_register() resultHarald Welte1-1/+5
Change-Id: I72d713725d287d32ec90506099751aeb9b15ef15 Fixes: Coverity CID 70462
2016-11-26ipaccess-proxy: Check setsockopt() return valueHarald Welte1-1/+7
Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Fixes: Coverity CID 57642
2016-11-26ipaccess-config: Handle setsockopt return valueHarald Welte1-1/+6
Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Fixes: Coverity CID 57640
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr1-0/+1
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-24move to libcommon-cs: net init 2: move bsc_network_init decl to new .hNeels Hofmeyr1-1/+1
bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-24move to libcommon-cs: net init 1: rename to bsc_network_initNeels Hofmeyr1-1/+1
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-15abisip-find: use protocol constantMax1-2/+2
Use library define instead of directly using hardcoded value. Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413
2016-10-13msgb talloc ctx: initialize in all main() scopesNeels Hofmeyr2-0/+2
Add msgb_talloc_ctx_init() call to many main() functions still lacking a msgb talloc context. Change-Id: Ib0d6751260659cabf18a7ce80680ba2fb4228ea1
2016-10-13ipaccess-config: initialize root talloc ctx with nameNeels Hofmeyr1-0/+2
tall_ctx_config is defined but remains NULL. Instead initialize as named const. Change-Id: Iec708eda2e4f8eb88b9e5bc5f82f6342709760b1
2016-09-26mscsplit: gsm_network_init(): add explicit root talloc ctxNeels Hofmeyr1-1/+1
Decouple the root talloc context from libbsc's global talloc_bsc_ctx. This allows to define the root talloc ctx from a main() scope, which in turn helps decouple libmsc from libbsc. Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer1-21/+61
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-05-21drop unneccessary duplicate/unused linking: ipaccessNeels Hofmeyr1-5/+0
Drop unused linking of libmsc, and drop duplicate linking of libbsc. Change-Id: If2d63adb832c72ff1a22c25a78e06b0c244628d2 Reviewed-on: https://gerrit.osmocom.org/88 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-02-25ipaccess_rcvmsg: fix returncode, add partial write warningNeels Hofmeyr1-1/+7
Kills a compiler warning.
2016-02-18rename ipaccess-find into abisip-findHarald Welte2-4/+4
The tool is not used only to find ip.access devices, but used to find any Abis/IP implementing devices, including those supported by OsmoBTS.
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte1-1/+1
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2014-08-20adopt recent IPA related symbol renameHarald Welte2-7/+10
... which happened during recent migration of IPA functionality from libosmo-abis into libosmocore.
2014-08-18ipaccess-proxy: avoid namespace collision with libosmo-abisHarald Welte1-15/+17
2014-06-12proxy: Annotate the switch/case/fall throughHolger Hans Peter Freyther1-0/+1
Use the same comment as some lines earlier in that file. Fixes: Coverity CID 1040737
2014-05-09ipa: Fix the compilation of ipaccess-find on FreeBSDNikola Kolev1-0/+5
FreeBSD does not offer the SO_BINDTODEVICE option. The closest thing is the IP_RECVIF option and this is used here now.
2014-04-04ipa: Fix compiler warnings about aliasingHolger Hans Peter Freyther1-3/+6
Use memcpy to copy from the OML message into the stack and then convert the network byte order. network_listen.c: In function ‘test_rep’: network_listen.c:145:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] test_rep_len = ntohs(*(uint16_t *) &foh->data[3]); ^ network_listen.c:153:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ferr_list_len = ntohs(*(uint16_t *) &foh->data[7]); ^ network_listen.c:164:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ferr_list_len = ntohs(*(uint16_t *) &foh->data[7]); ^ network_listen.c:130:11: warning: variable ‘test_rep_len’ set but not used [-Wunused-but-set-variable] uint16_t test_rep_len, ferr_list_len;
2013-12-13build: Remove bogus depends from ipaccess-configHolger Hans Peter Freyther1-2/+1
The code does not use libmsc and doesn't use dlsym/dlopen etc. So let us remove LIBRARY_DL as dependency.
2013-12-13freebsd: dlopen/dlsym/dlerror is part of libc, use LIBRARY_DL for linkingNikola1-1/+1
In FreeBSD there is no spearate library for dlopen, dlsym and dlerror. Use LIBRARY_DL to check for this condition.
2013-12-12ipa-proxy: Socket creation can fail, address coverity issueHolger Hans Peter Freyther1-0/+7
Fixes: Coverity CID 1040722
2013-11-11ipa: Explain that one needs to get the IP address of the BTS as argumentHolger Hans Peter Freyther1-1/+1
2013-07-14ipaccess: The proxy code checked the array but not the elementHolger Hans Peter Freyther1-1/+1
Array compared against 0 (NO_EFFECT) array_null: Comparing an array to null is not useful: "ipbc->bsc_rsl_conn". Fixes: Coverity CID 1040718
2013-07-14ipaccess: Fix a resource leak in case the stat is failingHolger Hans Peter Freyther1-0/+1
Close the file when the stat is failing. Fixes: Coverity CID 1040711
2013-07-04ipaccess-config: Add missing break to parsing the -L optionHolger Hans Peter Freyther1-0/+1
Fixes: Coverity CID 1040738
2013-07-04ipaccess-config: Fix a resource leak in an error pathHolger Hans Peter Freyther1-0/+1
Fixes: Coverity CID 1040710, CID 1040711
2013-07-03ipaccess-find: Address a warning by coverity of unitialized memoryHolger Hans Peter Freyther1-0/+1
Use a memset on the sockaddr_in to make coverity happy. Fixes: CID 1040705
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-04-29ipaccess: Remove the ipaccess_gsmnet and assume there is a bsc_gsmnetHolger Hans Peter Freyther1-4/+4
Assume that there is a bsc_gsmnet and modify the ipaccess-config to provide this symbol. If a bsc_gsmmnet is not available when linked the linker will complain and fail. E.g. give an error like this: ../../src/libbsc/libbsc.a(bts_ipaccess_nanobts.o): In function `ipaccess_sign_link_up': src/libbsc/bts_ipaccess_nanobts.c:550: undefined reference to `bsc_gsmnet'
2011-10-16misc: Linking fixes for Ubuntu 11.10 CompilerHolger Hans Peter Freyther1-4/+7
Ubuntu 11.10 has changed some linker/compiler flags. Some fixes for this can be seen here[1]. In general the to be linked libs need to be moved into the LDADD section of parameters. This is with the old BFD linker (not gold). This is likely to end in some ping-pong with other versions of the linker. [1] https://bugs.launchpad.net/ubuntu/+source/nis/+bug/771034 Errors: /usr/bin/ld.bfd.real: bsc_hack.o: undefined reference to symbol 'osmo_init_ignore_signals' /usr/bin/ld.bfd.real: note: 'osmo_init_ignore_signals' is defined in DSO /home/ich/install/openbsc/lib/libosmocore.so so try adding it to the linker command line /home/ich/install/openbsc/lib/libosmocore.so: could not read symbols: Invalid operation ... ../../src/libbsc/libbsc.a(rest_octets.o):/home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:381: more undefined references to `bitvec_set_bit' follow ../../src/libbsc/libbsc.a(rest_octets.o): In function `rest_octets_si13': /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:382: undefined reference to `bitvec_set_uint' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:383: undefined reference to `bitvec_set_uint' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:385: undefined reference to `bitvec_set_bit' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:402: undefined reference to `bitvec_set_bit' /home/ich/source/gsm/openbsc/openbsc/src/libbsc/rest_octets.c:403: undefined reference to `bitvec_set_uint'
2011-08-19src: port openBSC over libosmo-abisopenbsc/0.9.15Pablo Neira Ayuso4-67/+152
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
2011-08-19src: use new msg->dst pointer instead of deprecated msg->trxPablo Neira Ayuso1-4/+7
This patch modifies openBSC code to use msg->dst which stores the pointer to the signalling link structure instead of the pointer to the transceiver structure. This patch prepares the introduction of libosmo-abis.
2011-07-16ipaccess-firmware: Fix dumping the wrong header fieldsHolger Hans Peter Freyther1-2/+2
We want to compare the file more_magic[0] and more_magic[1] with the static more_magic array to see where the difference is. src/ipaccess/ipaccess-firmware.c +64 ipaccess_analyze_file(26) warn: buffer overflow 'firmware_header->more_magic' 2 <= 2 src/ipaccess/ipaccess-firmware.c +64 ipaccess_analyze_file(26) warn: buffer overflow 'firmware_header->more_magic' 2 <= 3
2011-07-16ipaccess-proxy: use ANSI function declarations (void)Harald Welte1-2/+2
2011-07-16ipaccess-proxy: fix array bounds problemHarald Welte1-2/+2
detected by Smatch: /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +173 store_idtags(14) error: buffer overflow 'ipbc->id_tags' 255 <= 255 /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +173 store_idtags(14) error: buffer overflow 'ipbc->id_tags' 255 <= 255 /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +175 store_idtags(16) error: buffer overflow 'ipbc->id_tags' 255 <= 255 /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +178 store_idtags(19) error: buffer overflow 'ipbc->id_tags' 255 <= 255 /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +500 ipaccess_rcvmsg(66) error: buffer overflow 'ipbc->rsl_conn' 4 <= 4 /home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +504 ipaccess_rcvmsg(70) error: buffer overflow 'ipbc->bsc_rsl_conn' 4 <= 4
2011-06-05split gsm_data.c in gsm_data_shared.c and gsm_data.cHarald Welte1-2/+2
This facilitates the use of gsm_data.c from osmo-bts
2011-05-17ipaccess: Fix the case of specifying the interfaceHolger Hans Peter Freyther1-0/+1
Pablo pointed out that my previous commit was rubish. If we have less than two arguments we want ifname to remain NULL and if we have a second argument (or more) we want to use that as the interface name to bind to.
2011-05-14ipaccess-find: Work without providing an interface nameHolger Hans Peter Freyther1-3/+2
This will use the default route of the operating system, e.g. be able to use ipaccess-find without special permission.
2011-05-12misc: Use the osmo_init code for signals and loggingHolger Hans Peter Freyther2-19/+12
Use the libosmocore code to ignore certain signals by default (e.g. SIGHUP, SIGPIPE) and use the new code to create a default stderr logging target and initialize it properly.
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso4-9/+9
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-06src: use namespace prefix osmo_signal*Pablo Neira Ayuso2-4/+4
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-05-06src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso3-38/+38
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-05-06src: use namespace prefix osmo_timer* for timer functionsPablo Neira Ayuso2-7/+7
Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther3-3/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther4-35/+35
This was done with sed on the files.
2011-04-12ipaccess-proxy: get rid of make_gprs_sock()Pablo Neira Ayuso1-33/+7
It is similar to make_sock() available in openbsc/libcommon.