Projects
osmocom:master
libosmo-netif
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 55
View file
libosmo-netif.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmo-netif Requires: osmocom-master -Version: 1.3.0.35.7fe2 +Version: 1.3.0.37.8355 Release: 0 Summary: Osmocom library for muxed audio License: GPL-2.0-or-later Group: Productivity/Telephony/Utilities URL: https://osmocom.org/projects/libosmo-netif -Source: libosmo-netif_1.3.0.35.7fe2.tar.xz +Source: libosmo-netif_1.3.0.37.8355.tar.xz Source1: rpmlintrc BuildRequires: automake BuildRequires: libtool >= 2
View file
commit_7fe21f67f647a1cede87042911588e57b17580c6.txt
Deleted
View file
commit_8355b65d9bcfd50c3ae666824464ab4789863345.txt
Added
View file
libosmo-netif_1.3.0.35.7fe2.dsc -> libosmo-netif_1.3.0.37.8355.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmo-netif Binary: libosmonetif11, libosmo-netif-dev, libosmo-netif-doc, libosmo-netif-dbg Architecture: any all -Version: 1.3.0.35.7fe2 +Version: 1.3.0.37.8355 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmo-netif Standards-Version: 3.9.6 @@ -15,8 +15,8 @@ libosmo-netif-doc deb doc optional arch=all libosmonetif11 deb libs optional arch=any Checksums-Sha1: - a43542499f687f921e767f572b6b3719ca244295 183700 libosmo-netif_1.3.0.35.7fe2.tar.xz + 1b67f163e10f6241eac2c2724b758cb5dff56226 183696 libosmo-netif_1.3.0.37.8355.tar.xz Checksums-Sha256: - 83b32149bb36d8ff06daefb406dd004ba956a23ba0f3d7846c94aa5258948e31 183700 libosmo-netif_1.3.0.35.7fe2.tar.xz + 4613059e422fcac4a19292b9f4097283ea7089f0aa1c35774eb58ec019671da5 183696 libosmo-netif_1.3.0.37.8355.tar.xz Files: - 97c80e4b1387f8af1ff40e1ee019426d 183700 libosmo-netif_1.3.0.35.7fe2.tar.xz + 077092f0407d4bfcd4a61550a771a06d 183696 libosmo-netif_1.3.0.37.8355.tar.xz
View file
libosmo-netif_1.3.0.35.7fe2.tar.xz/.tarball-version -> libosmo-netif_1.3.0.37.8355.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.3.0.35-7fe2 +1.3.0.37-8355
View file
libosmo-netif_1.3.0.35.7fe2.tar.xz/debian/changelog -> libosmo-netif_1.3.0.37.8355.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmo-netif (1.3.0.35.7fe2) unstable; urgency=medium +libosmo-netif (1.3.0.37.8355) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Mon, 07 Aug 2023 13:11:09 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Mon, 07 Aug 2023 16:36:04 +0000 libosmo-netif (1.3.0) unstable; urgency=medium
View file
libosmo-netif_1.3.0.35.7fe2.tar.xz/examples/ipa-stream-client.c -> libosmo-netif_1.3.0.37.8355.tar.xz/examples/ipa-stream-client.c
Changed
@@ -74,7 +74,7 @@ char *ptr; int x; - msg = osmo_ipa_msg_alloc(0); + msg = osmo_ipa_ext_msg_alloc(0); if (msg == NULL) { LOGP(DLINP, LOGL_ERROR, "cannot alloc msg\n"); return -1; @@ -93,6 +93,7 @@ msg_sent->num = i; llist_add(&msg_sent->head, &msg_sent_list); + ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_MGCP); osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO); osmo_stream_cli_send(conn, msg); @@ -115,7 +116,7 @@ int num; struct msg_sent *cur, *tmp, *found = NULL; - num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head)))); + num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head) + sizeof(struct ipa_head_ext)))); LOGP(DLINP, LOGL_DEBUG, "received msg number %d\n", num); llist_for_each_entry_safe(cur, tmp, &msg_sent_list, head) {
View file
libosmo-netif_1.3.0.35.7fe2.tar.xz/include/osmocom/netif/ipa.h -> libosmo-netif_1.3.0.37.8355.tar.xz/include/osmocom/netif/ipa.h
Changed
@@ -18,7 +18,18 @@ uint8_t data0; } __attribute__ ((packed)); +struct osmo_ipa_msgb_cb { + uint8_t proto; + uint8_t proto_ext; +} __attribute__ ((packed)); + +#define OSMO_IPA_MSGB_CB(__msg) ((struct osmo_ipa_msgb_cb *)&((__msg)->cb0)) +#define osmo_ipa_msgb_cb_proto(__x) OSMO_IPA_MSGB_CB(__x)->proto +#define osmo_ipa_msgb_cb_proto_ext(__x) OSMO_IPA_MSGB_CB(__x)->proto_ext + struct msgb *osmo_ipa_msg_alloc(int headroom); +struct msgb *osmo_ipa_ext_msg_alloc(size_t headroom); + void osmo_ipa_msg_push_header(struct msgb *msg, uint8_t proto); int osmo_ipa_process_msg(struct msgb *msg); @@ -40,4 +51,6 @@ int osmo_ipa_parse_msg_id_resp(struct msgb *msg, struct ipaccess_unit *unit_data); +int osmo_ipa_segmentation_cb(struct msgb *msg); + #endif
View file
libosmo-netif_1.3.0.35.7fe2.tar.xz/src/ipa.c -> libosmo-netif_1.3.0.37.8355.tar.xz/src/ipa.c
Changed
@@ -97,6 +97,11 @@ return msg; } +struct msgb *osmo_ipa_ext_msg_alloc(size_t headroom) +{ + return osmo_ipa_msg_alloc(sizeof(struct ipa_head_ext) + headroom); +} + void osmo_ipa_msg_push_header(struct msgb *msg, uint8_t proto) { struct ipa_head *hh; @@ -366,3 +371,68 @@ return 0; } + +#define MSG_CB_IPA_INFO_OFFSET 0 + +/* Check and remove headers (in case of p == IPAC_PROTO_OSMO, also the IPA extension header). + * Returns a negative number on error, otherwise the number of octets removed */ +static inline int ipa_check_pull_headers(struct msgb *msg) +{ + int ret; + size_t octets_removed = 0; + msg->l1h = msg->data; + struct ipa_head *ih = (struct ipa_head *)msg->data; + osmo_ipa_msgb_cb_proto(msg) = ih->proto; + + if ((ret = osmo_ipa_process_msg(msg)) < 0) { + LOGP(DLINP, LOGL_ERROR, "Error processing IPA message\n"); + return -EIO; + } + msgb_pull(msg, sizeof(struct ipa_head)); + octets_removed += sizeof(struct ipa_head); + msg->l2h = msg->data; + if (ih->proto != IPAC_PROTO_OSMO) + return octets_removed; + + osmo_ipa_msgb_cb_proto_ext(msg) = msg->data0; + msgb_pull(msg, sizeof(struct ipa_head_ext)); + octets_removed += sizeof(struct ipa_head_ext); + return octets_removed; +} + +/*! Segmentation callback used by libosmo-netif streaming backend + * See definition of `struct osmo_io_ops` for callback semantics + * \paramout msg Original `struct msgb` received via osmo_io + * \returns The total packet length indicated by the first header, + * otherwise negative number on error. Constants: + * -EAGAIN, if the header has not been read yet, + * -ENOBUFS, if the header declares a payload too large + */ +int osmo_ipa_segmentation_cb(struct msgb *msg) +{ + const struct ipa_head *hh = (const struct ipa_head *) msg->data; + size_t payload_len, total_len; + size_t available = msgb_length(msg) + msgb_tailroom(msg); + int removed_octets = 0; + + if (msgb_length(msg) < sizeof(*hh)) { + /* Haven't even read the entire header */ + return -EAGAIN; + } + payload_len = osmo_ntohs(hh->len); + total_len = sizeof(*hh) + payload_len; + if (OSMO_UNLIKELY(available < total_len)) { + LOGP(DLINP, LOGL_ERROR, "Not enough space left in message buffer. " + "Have %zu octets, but need %zu\n", + available, total_len); + return -ENOBUFS; + } + if (total_len <= msgb_length(msg)) { + removed_octets = ipa_check_pull_headers(msg); + if (removed_octets < 0) { + LOGP(DLINP, LOGL_ERROR, "Error pulling IPA headers\n"); + return removed_octets; + } + } + return total_len; +}
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.