mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr.git
synced 2025-10-23 00:12:14 +00:00
Each VLR requesting auth tuples should use a distinct IND pool for 3G auth. So far we tied the IND to the GSUP peer connection; MSC and SGSN were always distinct GSUP peers, they ended up using distinct INDs. However, we have implemented a GSUP proxy, so that, in a distributed setup, a remotely roaming subscriber has only one direct GSUP peer proxying for both remote MSC and SGSN. That means as soon as a subscriber roams to a different site, we would use the GSUP proxy name to determine the IND instead of the separate MSC and SGSN. The site's MSC and SGSN appear as the same client, get the same IND bucket, waste SQNs rapidly and cause auth tuple generation load. So instead of using the local client as IND, persistently keep a list of VLR names and assign a different IND to each. Use the gsup_req->source_name as indicator, which reflects the actual remote VLR's name (remote MSC or SGSN). Persist the site <-> IND assignments in the database. Add an IND test to db_test.c There was an earlier patch version that separated the IND pools by cn_domain, but it turned out to add complex semantics, while only solving one aspect of the "adjacent VLR" problem. We need a solution not only for CS vs PS, but also for 2,3G vs 4G, and for sites that are physically adjacent to each other. This patch version does not offer any automatic solution for that -- as soon as more than 2^IND_bitlen (usually 32) VLRs show up, it is the responsibility of the admin to ensure the 'ind' table in the hlr.db does not have unfortunate IND assignments. So far no VTY commands exist for that, they may be added in the future. Related: OS#4319 Change-Id: I6f0a6bbef3a27507605c3b4a0e1a89bdfd468374
77 lines
2.6 KiB
C
77 lines
2.6 KiB
C
#pragma once
|
|
|
|
#include <osmocom/core/linuxlist.h>
|
|
#include <osmocom/core/msgb.h>
|
|
#include <osmocom/abis/ipa.h>
|
|
#include <osmocom/abis/ipaccess.h>
|
|
#include <osmocom/gsm/gsup.h>
|
|
#include <osmocom/gsupclient/cni_peer_id.h>
|
|
#include <osmocom/gsupclient/gsup_req.h>
|
|
|
|
#ifndef OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN
|
|
#define OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN 43 /* TS 24.008 10.5.4.7 */
|
|
#endif
|
|
|
|
struct osmo_gsup_conn;
|
|
|
|
/* Expects message in msg->l2h */
|
|
typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb *msg);
|
|
|
|
struct osmo_gsup_server {
|
|
/* private data of the application/user */
|
|
void *priv;
|
|
|
|
/* list of osmo_gsup_conn */
|
|
struct llist_head clients;
|
|
|
|
struct ipa_server_link *link;
|
|
osmo_gsup_read_cb_t read_cb;
|
|
struct llist_head routes;
|
|
|
|
/* Proxy requests from this server's clients to remote GSUP servers. */
|
|
struct proxy *proxy;
|
|
};
|
|
|
|
|
|
/* a single connection to a given client (SGSN, MSC) */
|
|
struct osmo_gsup_conn {
|
|
struct llist_head list;
|
|
|
|
struct osmo_gsup_server *server;
|
|
struct ipa_server_conn *conn;
|
|
//struct oap_state oap_state;
|
|
struct tlv_parsed ccm;
|
|
|
|
/* Set when Location Update is received: */
|
|
bool supports_cs; /* client supports OSMO_GSUP_CN_DOMAIN_CS */
|
|
bool supports_ps; /* client supports OSMO_GSUP_CN_DOMAIN_PS */
|
|
|
|
/* The IPA unit name received on this link. Routes with more unit names serviced by this link may exist in
|
|
* osmo_gsup_server->routes, but this is the name the immediate peer identified as in the IPA handshake. */
|
|
struct osmo_ipa_name peer_name;
|
|
};
|
|
|
|
struct msgb *osmo_gsup_msgb_alloc(const char *label);
|
|
|
|
struct osmo_gsup_req *osmo_gsup_conn_rx(struct osmo_gsup_conn *conn, struct msgb *msg);
|
|
int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg);
|
|
int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr,
|
|
uint8_t tag);
|
|
|
|
struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
|
|
const char *ip_addr,
|
|
uint16_t tcp_port,
|
|
osmo_gsup_read_cb_t read_cb,
|
|
void *priv);
|
|
|
|
void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
|
|
|
|
int osmo_gsup_configure_wildcard_apn(struct osmo_gsup_message *gsup,
|
|
uint8_t *apn_buf, size_t apn_buf_size);
|
|
int osmo_gsup_create_insert_subscriber_data_msg(struct osmo_gsup_message *gsup, const char *imsi, const char *msisdn,
|
|
uint8_t *msisdn_enc, size_t msisdn_enc_size,
|
|
uint8_t *apn_buf, size_t apn_buf_size,
|
|
enum osmo_gsup_cn_domain cn_domain);
|
|
int osmo_gsup_forward_to_local_peer(struct osmo_gsup_server *server, const struct osmo_cni_peer_id *to_peer,
|
|
struct osmo_gsup_req *req, struct osmo_gsup_message *modified_gsup);
|