ipa: rename functions for consistency
As we are breaking builds by moving functions from libosmo-abis to
libosmocore anyway, we might as well give functions more appropriate
names. ipaccess is a company, while IPA is the multiplex protocol, and
CCM is the protocol used for establishing identities on the IPA
multiplex.
diff --git a/include/Makefile.am b/include/Makefile.am
index 3b35b7b..7484e9e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -58,7 +58,7 @@
osmocom/gsm/gsm48.h \
osmocom/gsm/gsm48_ie.h \
osmocom/gsm/gsm_utils.h \
- osmocom/gsm/ipaccess.h \
+ osmocom/gsm/ipa.h \
osmocom/gsm/lapd_core.h \
osmocom/gsm/lapdm.h \
osmocom/gsm/meas_rep.h \
diff --git a/include/osmocom/gsm/ipaccess.h b/include/osmocom/gsm/ipa.h
similarity index 64%
rename from include/osmocom/gsm/ipaccess.h
rename to include/osmocom/gsm/ipa.h
index dd56069..2878676 100644
--- a/include/osmocom/gsm/ipaccess.h
+++ b/include/osmocom/gsm/ipa.h
@@ -20,41 +20,41 @@
};
/* obtain the human-readable name of an IPA CCM ID TAG */
-const char *ipaccess_idtag_name(uint8_t tag);
+const char *ipa_ccm_idtag_name(uint8_t tag);
/* parse a buffer of ID tags into a osmocom TLV style representation */
-int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len);
+int ipa_ccm_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len);
/* parse an Unit ID in string format into the 'ipaccess_unit' data structure */
-int ipaccess_parse_unitid(const char *str, struct ipaccess_unit *unit_data);
+int ipa_parse_unitid(const char *str, struct ipaccess_unit *unit_data);
/* fill a 'struct ipaccess_unit' based on a parsed IDTAG TLV */
-int ipaccess_tlv_to_unitdata(struct ipaccess_unit *ud,
+int ipa_ccm_tlv_to_unitdata(struct ipaccess_unit *ud,
const struct tlv_parsed *tp);
/* Send an IPA message to the given FD */
-int ipaccess_send(int fd, const void *msg, size_t msglen);
+int ipa_send(int fd, const void *msg, size_t msglen);
/* Send an IPA CCM PONG via the given FD */
-int ipaccess_send_pong(int fd);
+int ipa_ccm_send_pong(int fd);
/* Send an IPA CCM ID_ACK via the given FD */
-int ipaccess_send_id_ack(int fd);
+int ipa_ccm_send_id_ack(int fd);
/* Send an IPA CCM ID_REQ via the given FD */
-int ipaccess_send_id_req(int fd);
+int ipa_ccm_send_id_req(int fd);
/* Common handling of IPA CCM, BSC side */
-int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd);
+int ipa_ccm_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd);
/* Common handling of IPA CCM, BTS side */
-int ipaccess_rcvmsg_bts_base(struct msgb *msg, struct osmo_fd *bfd);
+int ipa_ccm_rcvmsg_bts_base(struct msgb *msg, struct osmo_fd *bfd);
/* prepend (push) an ipaccess_head_ext to the msgb */
-void ipaccess_prepend_header_ext(struct msgb *msg, int proto);
+void ipa_prepend_header_ext(struct msgb *msg, int proto);
/* prepend (push) an ipaccess_head to the msgb */
-void ipaccess_prepend_header(struct msgb *msg, int proto);
+void ipa_prepend_header(struct msgb *msg, int proto);
struct msgb *ipa_msg_alloc(int headroom);
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 06b1f18..b8009ac 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -19,7 +19,7 @@
auth_core.c auth_comp128v1.c auth_comp128v23.c \
auth_milenage.c milenage/aes-encblock.c \
milenage/aes-internal.c milenage/aes-internal-enc.c \
- milenage/milenage.c gan.c ipaccess.c
+ milenage/milenage.c gan.c ipa.c
libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined
libosmogsm_la_LIBADD = $(top_builddir)/src/libosmocore.la
diff --git a/src/gsm/ipaccess.c b/src/gsm/ipa.c
similarity index 87%
rename from src/gsm/ipaccess.c
rename to src/gsm/ipa.c
index cddbd53..35a0775 100644
--- a/src/gsm/ipaccess.c
+++ b/src/gsm/ipa.c
@@ -36,7 +36,7 @@
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/protocol/ipaccess.h>
-#include <osmocom/gsm/ipaccess.h>
+#include <osmocom/gsm/ipa.h>
#define IPA_ALLOC_SIZE 1200
@@ -79,7 +79,7 @@
[IPAC_IDTAG_UNIT] = "Unit_ID",
};
-const char *ipaccess_idtag_name(uint8_t tag)
+const char *ipa_ccm_idtag_name(uint8_t tag)
{
if (tag >= ARRAY_SIZE(idtag_names))
return "unknown";
@@ -87,7 +87,7 @@
return idtag_names[tag];
}
-int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
+int ipa_ccm_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
{
uint8_t t_len;
uint8_t t_tag;
@@ -105,7 +105,7 @@
return -EINVAL;
}
- DEBUGPC(DLMI, "%s='%s' ", ipaccess_idtag_name(t_tag), cur);
+ DEBUGPC(DLMI, "%s='%s' ", ipa_ccm_idtag_name(t_tag), cur);
dec->lv[t_tag].len = t_len;
dec->lv[t_tag].val = cur;
@@ -116,7 +116,7 @@
return 0;
}
-int ipaccess_parse_unitid(const char *str, struct ipaccess_unit *unit_data)
+int ipa_parse_unitid(const char *str, struct ipaccess_unit *unit_data)
{
unsigned long ul;
char *endptr;
@@ -149,7 +149,7 @@
return 0;
}
-int ipaccess_tlv_to_unitdata(struct ipaccess_unit *ud,
+int ipa_ccm_tlv_to_unitdata(struct ipaccess_unit *ud,
const struct tlv_parsed *tp)
{
int rc = 0;
@@ -186,14 +186,14 @@
}
if (TLVP_PRES_LEN(tp, IPAC_IDTAG_UNIT, 1))
- rc = ipaccess_parse_unitid((char *)
+ rc = ipa_parse_unitid((char *)
TLVP_VAL(tp, IPAC_IDTAG_UNIT), ud);
out:
return rc;
}
-int ipaccess_send(int fd, const void *msg, size_t msglen)
+int ipa_send(int fd, const void *msg, size_t msglen)
{
int ret;
@@ -201,36 +201,36 @@
if (ret < 0)
return ret;
if (ret < msglen) {
- LOGP(DLINP, LOGL_ERROR, "ipaccess_send: short write\n");
+ LOGP(DLINP, LOGL_ERROR, "ipa_send: short write\n");
return -EIO;
}
return ret;
}
-int ipaccess_send_pong(int fd)
+int ipa_ccm_send_pong(int fd)
{
- return ipaccess_send(fd, ipa_pong_msg, sizeof(ipa_pong_msg));
+ return ipa_send(fd, ipa_pong_msg, sizeof(ipa_pong_msg));
}
-int ipaccess_send_id_ack(int fd)
+int ipa_ccm_send_id_ack(int fd)
{
- return ipaccess_send(fd, ipa_id_ack_msg, sizeof(ipa_id_ack_msg));
+ return ipa_send(fd, ipa_id_ack_msg, sizeof(ipa_id_ack_msg));
}
-int ipaccess_send_id_req(int fd)
+int ipa_ccm_send_id_req(int fd)
{
- return ipaccess_send(fd, ipa_id_req_msg, sizeof(ipa_id_req_msg));
+ return ipa_send(fd, ipa_id_req_msg, sizeof(ipa_id_req_msg));
}
/* base handling of the ip.access protocol */
-int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd)
+int ipa_ccm_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd)
{
uint8_t msg_type = *(msg->l2h);
int ret;
switch (msg_type) {
case IPAC_MSGT_PING:
- ret = ipaccess_send_pong(bfd->fd);
+ ret = ipa_ccm_send_pong(bfd->fd);
if (ret < 0) {
LOGP(DLINP, LOGL_ERROR, "Cannot send PING "
"message. Reason: %s\n", strerror(errno));
@@ -244,7 +244,7 @@
break;
case IPAC_MSGT_ID_ACK:
DEBUGP(DLMI, "ID_ACK? -> ACK!\n");
- ret = ipaccess_send_id_ack(bfd->fd);
+ ret = ipa_ccm_send_id_ack(bfd->fd);
if (ret < 0) {
LOGP(DLINP, LOGL_ERROR, "Cannot send ID_ACK "
"message. Reason: %s\n", strerror(errno));
@@ -261,15 +261,14 @@
}
/* base handling of the ip.access protocol */
-int ipaccess_rcvmsg_bts_base(struct msgb *msg,
- struct osmo_fd *bfd)
+int ipa_ccm_rcvmsg_bts_base(struct msgb *msg, struct osmo_fd *bfd)
{
uint8_t msg_type = *(msg->l2h);
int ret = 0;
switch (msg_type) {
case IPAC_MSGT_PING:
- ret = ipaccess_send_pong(bfd->fd);
+ ret = ipa_ccm_send_pong(bfd->fd);
if (ret < 0) {
LOGP(DLINP, LOGL_ERROR, "Cannot send PONG "
"message. Reason: %s\n", strerror(errno));
@@ -286,7 +285,7 @@
}
-void ipaccess_prepend_header_ext(struct msgb *msg, int proto)
+void ipa_prepend_header_ext(struct msgb *msg, int proto)
{
struct ipaccess_head_ext *hh_ext;
@@ -295,7 +294,7 @@
hh_ext->proto = proto;
}
-void ipaccess_prepend_header(struct msgb *msg, int proto)
+void ipa_prepend_header(struct msgb *msg, int proto)
{
struct ipaccess_head *hh;
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 50f5913..d82c8a0 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -246,5 +246,21 @@
gan_msgt_vals;
gan_pdisc_vals;
+ipa_ccm_rcvmsg_base;
+ipa_ccm_rcvmsg_bts_base;
+ipa_ccm_send_id_ack;
+ipa_ccm_send_id_req;
+ipa_ccm_send_pong;
+ipa_ccm_tlv_to_unitdata;
+ipa_ccm_idtag_name;
+ipa_ccm_idtag_parse;
+ipa_msg_alloc;
+ipa_msg_recv;
+ipa_msg_recv_buffered;
+ipa_parse_unitid;
+ipa_prepend_header;
+ipa_prepend_header_ext;
+ipa_send;
+
local: *;
};