libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Functions
oap_client.c File Reference
`#include <string.h>`
`#include <errno.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/crypt/auth.h>`
`#include <osmocom/gsm/oap.h>`
`#include <osmocom/gsm/oap_client.h>`

## Functions
int | osmo_oap_client_init (struct osmo_oap_client_config *config, struct osmo_oap_client_state *state)
static int | oap_evaluate_challenge (const struct osmo_oap_client_state *state, const uint8_t *rx_random, const uint8_t *rx_autn, uint8_t *tx_xres)
struct msgb * | osmo_oap_client_encoded (const struct osmo_oap_message *oap_msg)
static struct msgb * | oap_msg_register (uint16_t client_id)
int | osmo_oap_client_register (struct osmo_oap_client_state *state, struct msgb **msg_tx)
static struct msgb * | oap_msg_challenge_response (uint8_t *xres)
static int | handle_challenge (struct osmo_oap_client_state *state, struct osmo_oap_message *oap_rx, struct msgb **msg_tx)
int | osmo_oap_client_handle (struct osmo_oap_client_state *state, const struct msgb *msg_rx, struct msgb **msg_tx)

## Function Documentation

## ◆ handle_challenge()

static int handle_challenge | ( | struct osmo_oap_client_state * | state,
|  | struct osmo_oap_message * | oap_rx,
|  | struct msgb ** | msg_tx
| ) |  |
| static

References osmo_oap_message::autn, osmo_oap_message::autn_present, DLOAP, LOGL_ERROR, LOGP, oap_evaluate_challenge(), oap_msg_challenge_response(), OSMO_ASSERT, osmo_oap_message::rand, osmo_oap_message::rand_present, osmo_oap_client_state::state, and osmo_oap_message::xres.

Referenced by osmo_oap_client_handle().

## ◆ oap_evaluate_challenge()

static int oap_evaluate_challenge | ( | const struct osmo_oap_client_state * | state,
|  | const uint8_t * | rx_random,
|  | const uint8_t * | rx_autn,
|  | uint8_t * | tx_xres
| ) |  |
| static

References osmo_sub_auth_data::amf, osmo_auth_vector::autn, DLOAP, osmo_sub_auth_data::k, LOGL_ERROR, LOGL_INFO, LOGP, osmo_sub_auth_data::opc, OSMO_AUTH_ALG_MILENAGE, osmo_auth_gen_vec(), OSMO_AUTH_TYPE_UMTS, osmo_constant_time_cmp(), osmo_hexdump_nospc(), osmo_static_assert(), osmo_auth_vector::res, osmo_auth_vector::res_len, osmo_oap_client_state::secret_k, osmo_oap_client_state::secret_opc, osmo_sub_auth_data::sqn, osmo_oap_client_state::state, osmo_sub_auth_data::type, osmo_sub_auth_data::u, and osmo_sub_auth_data::umts.

Referenced by handle_challenge().

## ◆ oap_msg_challenge_response()

static struct msgb * oap_msg_challenge_response | ( | uint8_t * | xres | ) |
| static

References osmo_oap_message::message_type, OAP_MSGT_CHALLENGE_RESULT, osmo_oap_client_encoded(), osmo_oap_message::xres, and osmo_oap_message::xres_present.

Referenced by handle_challenge().

## ◆ oap_msg_register()

static struct msgb * oap_msg_register | ( | uint16_t | client_id | ) |
| static

References osmo_oap_message::client_id, DLOAP, LOGL_ERROR, LOGP, osmo_oap_message::message_type, OAP_MSGT_REGISTER_REQUEST, and osmo_oap_client_encoded().

Referenced by osmo_oap_client_register().

## ◆ osmo_oap_client_encoded()

struct msgb * osmo_oap_client_encoded | ( | const struct osmo_oap_message * | oap_msg | ) |

References msg, msgb_alloc_headroom(), OSMO_ASSERT, and osmo_oap_encode().

Referenced by oap_msg_challenge_response(), and oap_msg_register().

## ◆ osmo_oap_client_handle()

int osmo_oap_client_handle | ( | struct osmo_oap_client_state * | state,
|  | const struct msgb * | msg_rx,
|  | struct msgb ** | msg_tx
| ) |  |

References data, DLOAP, get_value_string(), gsm48_gmm_cause_names, handle_challenge(), LOGL_ERROR, LOGP, osmo_oap_message::message_type, msgb_l2, msgb_l2len(), OAP_MSGT_CHALLENGE_REQUEST, OAP_MSGT_CHALLENGE_RESULT, OAP_MSGT_REGISTER_ERROR, OAP_MSGT_REGISTER_REQUEST, OAP_MSGT_REGISTER_RESULT, OSMO_ASSERT, osmo_oap_client_register(), osmo_oap_decode(), osmo_oap_client_state::registration_failures, and osmo_oap_client_state::state.

## ◆ osmo_oap_client_init()

int osmo_oap_client_init | ( | struct osmo_oap_client_config * | config,
|  | struct osmo_oap_client_state * | state
| ) |  |

References osmo_oap_client_state::client_id, config, DLOAP, LOGL_NOTICE, LOGP, OSMO_ASSERT, osmo_oap_client_state::secret_k, osmo_oap_client_state::secret_opc, and osmo_oap_client_state::state.

## ◆ osmo_oap_client_register()

int osmo_oap_client_register | ( | struct osmo_oap_client_state * | state,
|  | struct msgb ** | msg_tx
| ) |  |

References osmo_oap_client_state::client_id, oap_msg_register(), and osmo_oap_client_state::state.

Referenced by osmo_oap_client_handle().