oap: rename public API from oap_ to oap_client_
Mainly to differentiate the OAP messaging API (osmo_oap_ in libosmocore) from
the OAP client.
This is in preparation for moving the oap client to libcommon, which is in turn
preparation for libvlr. Add the osmo_ prefix, as all public Osmocom API should
have. We also have OAP messages code in libosmocore, so clarify by naming this
osmo_oap_client, and by also renaming the oap_test to oap_client_test. This
reshuffling will allow an easy move of OAP to libosmocore if we should want to
do that. A number of patches will follow up on this.
Related: OS#1592
Change-Id: Id447d2bebc026a375567654adafa5f82439ea7e1
diff --git a/openbsc/include/openbsc/gsup_client.h b/openbsc/include/openbsc/gsup_client.h
index 551f76d..d21a54d 100644
--- a/openbsc/include/openbsc/gsup_client.h
+++ b/openbsc/include/openbsc/gsup_client.h
@@ -41,7 +41,7 @@
gsup_client_read_cb_t read_cb;
void *data;
- struct oap_state oap_state;
+ struct oap_client_state oap_state;
struct osmo_timer_list ping_timer;
struct osmo_timer_list connect_timer;
@@ -52,7 +52,7 @@
struct gsup_client *gsup_client_create(const char *ip_addr,
unsigned int tcp_port,
gsup_client_read_cb_t read_cb,
- struct oap_config *oap_config);
+ struct oap_client_config *oap_config);
void gsup_client_destroy(struct gsup_client *gsupc);
int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg);
diff --git a/openbsc/include/openbsc/oap.h b/openbsc/include/openbsc/oap.h
index 2206184..80c86d5 100644
--- a/openbsc/include/openbsc/oap.h
+++ b/openbsc/include/openbsc/oap.h
@@ -27,9 +27,10 @@
struct msgb;
struct osmo_oap_message;
-/* This is the config part for vty. It is essentially copied in oap_state,
- * where values are copied over once the config is considered valid. */
-struct oap_config {
+/* This is the config part for vty. It is essentially copied in
+ * oap_client_state, where values are copied over once the config is
+ * considered valid. */
+struct oap_client_config {
uint16_t client_id;
int secret_k_present;
uint8_t secret_k[16];
@@ -38,9 +39,10 @@
};
/* The runtime state of the OAP client. client_id and the secrets are in fact
- * duplicated from oap_config, so that a separate validation of the config data
- * is possible, and so that only a struct oap_state* is passed around. */
-struct oap_state {
+ * duplicated from oap_client_config, so that a separate validation of the
+ * config data is possible, and so that only a struct oap_client_state* is
+ * passed around. */
+struct oap_client_state {
enum {
OAP_UNINITIALIZED = 0, /* just allocated. */
OAP_DISABLED, /* disabled by config. */
@@ -56,23 +58,25 @@
};
/* From config, initialize state. Return 0 on success. */
-int oap_init(struct oap_config *config, struct oap_state *state);
+int oap_client_init(struct oap_client_config *config,
+ struct oap_client_state *state);
/* Construct an OAP registration message and return in *msg_tx. Use
* state->client_id and update state->state.
* Return 0 on success, or a negative value on error.
* If an error is returned, *msg_tx is guaranteed to be NULL. */
-int oap_register(struct oap_state *state, struct msgb **msg_tx);
+int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx);
/* Decode and act on a received OAP message msg_rx. Update state->state. If a
* non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP
* server (and freed) by the caller. The received msg_rx is not freed.
* Return 0 on success, or a negative value on error.
* If an error is returned, *msg_tx is guaranteed to be NULL. */
-int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb **msg_tx);
+int oap_client_handle(struct oap_client_state *state,
+ const struct msgb *msg_rx, struct msgb **msg_tx);
-/* Allocate a msgb and in it, return the encoded oap_msg. Return NULL on
- * error. (Like oap_encode(), but also allocates a msgb.)
- * About the name: the idea is do_something(oap_encoded(my_struct)) */
-struct msgb *oap_encoded(const struct osmo_oap_message *oap_msg);
-
+/* Allocate a msgb and in it, return the encoded oap_client_msg. Return
+ * NULL on error. (Like oap_client_encode(), but also allocates a msgb.)
+ * About the name: the idea is do_something(oap_client_encoded(my_struct))
+ */
+struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg);
diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 0045fae..c8dcc0d 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -92,7 +92,7 @@
int dynamic_lookup;
- struct oap_config oap;
+ struct oap_client_config oap;
/* RFC1144 TCP/IP header compression */
struct {