Commit Graph

14 Commits

Author SHA1 Message Date
arehbein 106b63907a stream: Add and use helper function osmo_ipa_push_headers()
Related OS#5753, OS#5751

Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529
2023-10-09 12:49:36 +00:00
arehbein 8355b65d9b ipa: Add segmentation callback
Related: OS#5753
Change-Id: I87ef4c7023126b783dd79e7ed47be31e1b76f975
2023-08-07 17:46:53 +02:00
arehbein 8712af589c examples: Add extension header octet to example
Mainly to make data/packets look (pseudo-)correct in Wireshark.

Also: Add helper for allocating message buffers with extended headroom for IPA.

Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502
2023-08-07 16:50:22 +02:00
Harald Welte da5f41cdad Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()
In libosmocore Change-ID I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f
we have introduced ipa_ccm_id_resp_parse() as a bugfixed replacement
of ipa_ccm_idtag_parse().

The main difference is that the returned "value" parts now have
a correct reported "length", whereas before this commit they all
reported a one-byte too-long "length" for each IE.

Let's use this opportunity to remove the copy+pasted
osmo_ipa_idtag_parse() function from the libosmo-netif codebase.

Change-Id: I4626d247626543e032593bf226b6c233f6678562
2018-08-01 17:36:21 +02:00
Harald Welte e2fbd3dee4 remove "channel" layer
The "channel" layer on top of IPA client + server was introduced in
2011 but never used in any osmocom program/project so far.  Contrary
to the several other IPA multiplex related implementations in libosmo*,
it did not deal properly with segmented IPA messages, i.e. where a
single TCP segment (and hence recv/read call) does not contain a full
IPA message.

So rather than fixing it up and having yet another IPA related API in
our libraries, let's remove it.

Change-Id: I97c378750acb1637ee032fa88a968edf68d8979f
2018-06-29 10:57:24 +02:00
Harald Welte bea215a565 Add SPDX-License-Identifier + Copyright statements
Change-Id: I43bb1c4a889421907a1a08eb29c96f2330ab00ec
2017-11-13 01:21:03 +09:00
Pablo Neira Ayuso 631c6fe0ad ipa: fix compilation warning
Shows up with gcc-4.7

ipa.c: In function 'osmo_ipa_rcvmsg_base':
ipa.c:210:6: warning: variable 'ret' set but not used [-Wunused-but-set-variabl
2012-10-15 23:09:36 +02:00
Pablo Neira Ayuso aa33e591dc ipa: add osmo_ipa_parse_msg_id_resp
Code extracted from ipa_stream_server.c.
2012-08-21 02:28:46 +02:00
Pablo Neira Ayuso 06f49051c6 ipa: add ipa_cli_id_ack and ipa_cli_id_resp
This functions were before located in channel/abis/ipa_stream_client.c,
but they are generic for IPA units.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso 9ae91e594c ipa: add osmo_ipa_process_msg and remove osmo_ipa_recv_msg
This patch removes osmo_ipa_recv_msg, it performs two syscall invocations
and it's stream generic. Now we use the specific receival function
we want to use (no matter if stream or datagram based) and then we
call osmo_ipa_process_msg to check that the IPA message correct.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso b247d6df81 ipa: change osmo_ipa_rcvmsg_base to take argument depending on role
If we're acting as client, we don't have to reply ID_ACK to
one received ID_ACK (otherwise, we enter a loop).
2012-08-16 00:31:40 +02:00
Pablo Neira Ayuso 2b5d3ce7c6 src: add generic channel infrastructure and A-bis IPA server support
This patch adds the generic channel infrastructure that allows to
create channel of different types. Each channel has their own
configuration functions.

  struct osmo_chan *chan;
  chan = osmo_chan_create(tall_example, CHAN_ABIS_IPA_SERVER);
  ...

  /* specific configuration functions per supported channel. */
  osmo_chan_abis_ipa_server_set_cb_signalmsg(chan, signal_msg_cb);
  osmo_chan_abis_ipa_unit_add(chan, 1801, 0);

  /* open channel. */
  osmo_chan_open(chan);

The input path requires a callback to be registered. The output path
is handled through:

  int osmo_chan_enqueue(struct osmo_chan *c, struct msgb *msg);

The msg->dst must be set (it can be taken from the original message
to route one reply).

This patch also adds A-bis IPA server support. It has been tested with
e1inp_ipa_bsc_test available in libosmo-abis.
2011-11-08 11:17:44 +01:00
Pablo Neira Ayuso ffe3cb3ef9 ipa: don't release message in osmo_ipa_msg_recv
The client of this code must control message freeing it self.
2011-11-08 11:17:44 +01:00
Pablo Neira Ayuso 20c660caec ipa: initial addition of helper functions and examples
This patch adds IPA helper function that can be use on top of stream
sockets.

The current API is just a copy and paste from libosmo-abis, it will
change in follow up patches to improve it.
2011-10-17 22:12:42 +02:00