summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/common/l1l2_interface.c
AgeCommit message (Collapse)AuthorFilesLines
2020-02-26layer23: Terminate process if L2 socket fails/dissappearsHarald Welte1-0/+1
We don't recover from this situation at all, so it's best to terminate the process. Change-Id: I487d18e4afe2cae9f777a30864e680b5dc821fc1
2018-11-19l1l2 interface: use LOGP for socket errorsMax1-1/+2
Log via LOGP() like the rest of the file instead of fprintf() for consistency. While at it, also print error cause. Change-Id: Id205bcd9bdb7c3e4b96493d50be8381a6fa80ac6
2018-10-26Report socket path on errorsMax1-1/+1
Change-Id: Ib63e1205d7b845c8779eb511635f26bae3a18085
2018-09-06layer23: Use osmo_sock_unix_init_ofd() from libosmocoreHarald Welte1-24/+4
We don't need to hand-code unix domain socket initialization but can simply use our library function for it. As an added benefit, the library code already contains corner case handling for non-NUL terminated unix domain socket path. Change-Id: I57c724c78dbbbce0546ebe914e370f32c8c89703
2018-08-11layer23: Replace all instances of strncpy() by osmo_strlcpyHarald Welte1-2/+1
This gives us working/safe zero termination without overflowing the destination string size. Change-Id: Ica6098ceba2bd01ce3b216085442cc5eed0ca507
2018-08-11layer23: fix unaligned store in osmo_send_l1()Harald Welte1-5/+2
This fixes the following alignment issue uncovered by asan: l1l2_interface.c:169:7: runtime error: store to misaligned address 0x61600001ab99 for type 'uint16_t', which requires 2 byte alignment 0x61600001ab99: note: pointer points here 00 00 00 00 00 00 06 0a 01 19 19 40 18 00 07 00 01 03 49 06 15 00 40 01 c0 00 00 00 00 00 00 00 ^ Change-Id: Ie65b428107d35bac99bc870fdbc4dc509ca2f33c
2011-11-13host/layer23: Flush L1CTL/SAP workqueues when exittingAndreas Eversberg1-0/+1
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-06misc: u_intX -> uintX in the host directoryHolger Hans Peter Freyther1-1/+1
Use C99 stdint.h for the inttypes.
2011-05-15src: use namespace prefix osmo_* for utilsPablo Neira Ayuso1-1/+1
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-15src: use namespace prefix osmo_wqueue*Pablo Neira Ayuso1-2/+2
Summary of changes: s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
2011-05-15src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-4/+4
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-04-26src: use new libosmogsm and include/osmocom/[gsm|core] path to headersPablo Neira Ayuso1-1/+1
This patch changes include paths to get osmocom-bb working with the current libosmocore tree. Among all these renames, you can notice several tweaks that I added on purpose, and that require some explanation, they are: * hexdump() in osmocon.c and osmoload.c has been renamed to avoid clashing with hexdump() defined in libosmocore. * gsmmap now depends on libosmogsm. Actually I had to cleanup Makefile.am because I was experiencing weird linking problems, probably due to a bug in the autotools. With the change included in this patch, I got it compiled and linked here correctly. This patch has been tested with the phone Motorola C123 and the following images files: * firmware/board/compal_e88/hello_world.compalram.bin * firmware/board/compal_e88/layer1.compalram.bin Using the osmocon, bcch_scan and mobile tools. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2010-12-11layer23: use correct sizeof(sockaddr) for connecting to L1CTL socketDavid Wilson1-2/+3
connect's addrlen should be sizeof(local), not the contained path's length. With the previous code, on OS X connect() will fail with ENOENT. This permits layer23 to work on OS X using the pl2303 driver, /dev/tty.usbserial , MacPorts arm-elf-gcc and RANLIB=arm-elf-ranlib Signed-off-by: Harald Welte <laforge@gnumonks.org>
2010-11-14[layer23] Prevent layer23 apps from abort, if socket to layer1 failsAndreas.Eversberg1-3/+10
2010-11-13[layer23] Added support for multiple MS instancesAndreas.Eversberg1-0/+1
To create another instance: 'ms <name> create' To remove an instance: 'no ms <name>' If no instance exists, 'ms 1' is created automatically on startup. Each instance can be enabled / disabled by using 'shutdown' or 'no shutdown'. Multiple instances may share the same layer2 socket (same phone hardware), but in this case only one instance can be enabled at the same time. This makes it much easier to select different settings without modifying them. A 'shutdown' initiates the IMSI detach procedure before shutdown is completed. A 'shutdown force' will immidiately shutdown. There is no need to restart the software anymore, if fundamental settings are changed. In this case, a 'shutdown' followed by a 'no shutdown' will do the job. If you already have an old osmocom.cfg, you need to "no shutdown" it. Everything else behaves as before.
2010-10-03misc: Fix the name of the header file for the hexdump...Holger Hans Peter Freyther1-1/+1
2010-10-03msic: Include osmocom/util.h for the hexdump definitionHolger Hans Peter Freyther1-0/+2
2010-09-18[layer23] Added BTSAP socket interface to layer23Andreas.Eversberg1-14/+14
2010-07-27layer23: Split [2/2] -> The header filesSylvain Munaut1-3/+3
This split the headers and adapt the source. We use osmocom/bb as a prefix because libosomore also uses osmocom and generic names such as misc & common could conflict in the future. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27layer23: Split [1/2] -> The source codeSylvain Munaut1-0/+168
We split into : - common: Everything that can be shared - mobile: The real spec compliant mobile phones - misc: Different test stuff Signed-off-by: Sylvain Munaut <tnt@246tNt.com>