diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-07-30 18:25:31 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-07-30 18:35:34 +0200 |
commit | 0b588be87e7bc506c45f333e060c29b4a5634c6f (patch) | |
tree | 789ddead1ccf8eb2a38e10869d313f6804e73363 /include | |
parent | b920c4fefd012c8e85aec635755625227bf6f491 (diff) |
migrate to oap_client in libosmogsm
libosmogsm in libosmocore.git from Change-Id
Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c,
so we don't need our local copy here in this repo anymore.
Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132
Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/sgsn/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/sgsn/gsup_client.h | 6 | ||||
-rw-r--r-- | include/osmocom/sgsn/oap_client.h | 82 | ||||
-rw-r--r-- | include/osmocom/sgsn/sgsn.h | 4 |
4 files changed, 5 insertions, 88 deletions
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 3f63b9fdc..269cebcd6 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -17,7 +17,6 @@ noinst_HEADERS = \ gprs_utils.h \ gsup_client.h \ gtphub.h \ - oap_client.h \ sgsn.h \ signal.h \ slhc.h \ diff --git a/include/osmocom/sgsn/gsup_client.h b/include/osmocom/sgsn/gsup_client.h index 29092ad5b..6ba0d1581 100644 --- a/include/osmocom/sgsn/gsup_client.h +++ b/include/osmocom/sgsn/gsup_client.h @@ -23,7 +23,7 @@ #include <osmocom/core/timer.h> -#include <osmocom/sgsn/oap_client.h> +#include <osmocom/gsm/oap_client.h> #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 @@ -43,7 +43,7 @@ struct gsup_client { gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -55,7 +55,7 @@ struct gsup_client *gsup_client_create(const char *unit_name, const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/sgsn/oap_client.h b/include/osmocom/sgsn/oap_client.h deleted file mode 100644 index 80c86d5d6..000000000 --- a/include/osmocom/sgsn/oap_client.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include <stdint.h> - -struct msgb; -struct osmo_oap_message; - -/* 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]; - int secret_opc_present; - uint8_t secret_opc[16]; -}; - -/* The runtime state of the OAP client. client_id and the secrets are in fact - * 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. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED - } state; - uint16_t client_id; - uint8_t secret_k[16]; - uint8_t secret_opc[16]; - int registration_failures; -}; - -/* From config, initialize state. Return 0 on success. */ -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_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_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_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/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index dae9d12aa..59d0bd72e 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -6,7 +6,7 @@ #include <osmocom/crypt/gprs_cipher.h> #include <osmocom/gprs/gprs_ns.h> #include <osmocom/sgsn/gprs_sgsn.h> -#include <osmocom/sgsn/oap_client.h> +#include <osmocom/gsm/oap_client.h> #include <osmocom/sgsn/common.h> #include "../../bscconfig.h" @@ -101,7 +101,7 @@ struct sgsn_config { int dynamic_lookup; - struct oap_client_config oap; + struct osmo_oap_client_config oap; /* RFC1144 TCP/IP header compression */ struct { |