pespin submitted this change.

View Change

Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve
ipaccess: Deprecate ipa_msg_push_header() API

We already have sibling APIs in libosmocore and libosmo-netif. There's
no need to have yet another API in libosmo-abis, which shouldn't export
public IPA related APIs (it's not its aim).

Replace internal use of ipa_msg_push_header() with libosmocore's
ipa_prepend_header() (the l2h is not really needed anywhere in there).

Change-Id: I59b216c8a5e5a8744d337773ccf6f8d674b9513d
---
M include/osmocom/abis/ipa.h
M src/input/ipa.c
M src/input/ipa_keepalive.c
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index 0a36d78..1a68d2e 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -2,6 +2,7 @@
#define _OSMO_IPA_H_

#include <stdint.h>
+#include <osmocom/core/defs.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
@@ -114,8 +115,7 @@
int ipaccess_bts_handle_ccm(struct ipa_client_conn *link,
struct ipaccess_unit *dev, struct msgb *msg);

-void ipa_msg_push_header(struct msgb *msg, uint8_t proto);
-
+void ipa_msg_push_header(struct msgb *msg, uint8_t proto) OSMO_DEPRECATED("Use libosmo-netif/osmo_ipa_msg_push_header() or libosmocore/ipa_prepend_header() instead");

/***********************************************************************
* IPA Keep-Alive FSM
diff --git a/src/input/ipa.c b/src/input/ipa.c
index 5b064e0..f902b95 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -26,6 +26,10 @@

#define LOGIPA(link, level, fmt, args...) LOGP(DLINP, level, "%s:%u " fmt, link->addr, link->port, ## args)

+/* Deprecated, use either:
+ * - libosmo-netif osmo_ipa_msg_push_header() [stores l2h as this API]
+ * - libosmocore's ipa_prepend_header() [doesn't store l2h]
+ */
void ipa_msg_push_header(struct msgb *msg, uint8_t proto)
{
struct ipaccess_head *hh;
diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c
index 6a8ae93..f105ded 100644
--- a/src/input/ipa_keepalive.c
+++ b/src/input/ipa_keepalive.c
@@ -38,7 +38,7 @@
return NULL;

msgb_put_u8(msg, IPAC_MSGT_PING);
- ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS);
+ ipa_prepend_header(msg, IPAC_PROTO_IPACCESS);

return msg;
}

To view, visit change 38814. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I59b216c8a5e5a8744d337773ccf6f8d674b9513d
Gerrit-Change-Number: 38814
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>