aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/ipaccess
AgeCommit message (Collapse)AuthorFilesLines
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-abis0.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.
2011-04-12ipaccess-proxy: remove leftover option `--udp'Pablo Neira Ayuso1-1/+0
It seems it remains unimplemented, remove it.
2011-04-12ipaccess-proxy: more robust option parsing and checkingPablo Neira Ayuso1-0/+15
With this patch, ipaccess-proxy makes more robust option checking: $ ./ipaccess-proxy -l 1.1.1.1 -b 2.2.2.2 -e ERROR: missing mandatory argument for `-e' option And we return to shell to enforce the user to try again with the appropriate invocation. Before this patch, the default getopt_long() error handling was enabled which displayed this message: ./ipaccess-proxy: option requires an argument -- 'e' and ipaccess-proxy continued working. This is generic enough to cover other option that require mandatory arguments like `--bsc' and `--listen'.
2011-04-12ipaccess-find: get rid of ipac_idtag_name()Pablo Neira Ayuso2-21/+7
Use generic ipaccess_idtag_name() available in libabis instead.
2011-04-11ipaccess-config: Allow to invoke tests by names.Holger Hans Peter Freyther1-1/+45
Allow to invoke tests by name.
2011-04-11ipaccess-config: Add option to list possible NVRAM settingsHolger Hans Peter Freyther1-1/+24
We can handle NVRAM settings via names but there is no way to discover these names. This commits adds the unusual -H option to show these values.
2011-04-11ipaccess-config: Allow to automatically loop a testHolger Hans Peter Freyther1-9/+15
This makes the commented out code an option that might or might not work reliable.
2011-04-07ipaccess-proxy: remove hardcoded IP for options `-l' and `-b'Pablo Neira Ayuso1-4/+19
This patch removes the hardcoded IP addresses for options `-l' and `-b'.
2011-04-07libabis: ipaccess: export ipaccess_parse_unitidPablo Neira Ayuso1-39/+2
Now this is used by ipaccess-proxy, remove redundant implementation in it.
2011-04-07ipaccess-proxy: get rid of ipac_idtag_parse()Pablo Neira Ayuso1-22/+2
Use ipaccess_idtag_parse() available in libabis instead.
2011-04-07libabis: ipaccess: export ipaccess_idtag_name()Pablo Neira Ayuso1-21/+1
Now this is used by ipaccess-proxy, remove redundant implemention in it.
2011-04-07libabis: ipaccess: conclude new ipaccess_send_*() functions and use themPablo Neira Ayuso2-25/+11
This patch finishes the new ipaccess_send_*() functions and use them in the ipaccess-proxy code. I have also cleanup the definition of the PONG, ID_ACK and ID_REQ messages (including some minor documentation about them). I had to rename ipaccess_recvmsg() in ipaccess-proxy to avoid clashing with the one defined in libabis.
2011-04-07ipaccess-proxy: get rid of make_listen_sock() and use make_sock() insteadPablo Neira Ayuso1-47/+4
This patch replaces make_listen_sock() by the generic make_sock() available in libcommon/socket.
2011-04-05ipaccess: proxy: get rid of internal make_sock() implementationPablo Neira Ayuso1-39/+3
With this patch, we use the implementation available in libcommon.