blob: 74062d4cd40022a81495b3234258e1c51f42f9a2 [file] [log] [blame]
Harald Weltee72cf552016-04-28 07:18:49 +02001#pragma once
2
3#include <osmocom/core/linuxlist.h>
4#include <osmocom/core/msgb.h>
5#include <osmocom/abis/ipa.h>
6#include <osmocom/abis/ipaccess.h>
7
8struct osmo_gsup_conn;
9
10/* Expects message in msg->l2h */
11typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb *msg);
12
13struct osmo_gsup_server {
14 /* list of osmo_gsup_conn */
15 struct llist_head clients;
16
Max9cacb6f2017-02-20 17:22:56 +010017 /* lu_operations list */
18 struct llist_head *luop;
19
Harald Weltee72cf552016-04-28 07:18:49 +020020 struct ipa_server_link *link;
21 osmo_gsup_read_cb_t read_cb;
Harald Weltee687be52016-05-03 18:49:27 +020022 struct llist_head routes;
Harald Weltee72cf552016-04-28 07:18:49 +020023};
24
25
26/* a single connection to a given client (SGSN, MSC) */
27struct osmo_gsup_conn {
28 struct llist_head list;
29
30 struct osmo_gsup_server *server;
31 struct ipa_server_conn *conn;
32 //struct oap_state oap_state;
Harald Weltee687be52016-05-03 18:49:27 +020033 struct tlv_parsed ccm;
Neels Hofmeyrcab2fcd2017-03-15 00:07:43 +010034
35 unsigned int auc_3g_ind; /*!< IND index used for UMTS AKA SQN */
Harald Weltee72cf552016-04-28 07:18:49 +020036};
37
38
39int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg);
Neels Hofmeyr6eed3222016-12-11 01:21:49 +010040int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr,
41 uint8_t tag);
Harald Weltee72cf552016-04-28 07:18:49 +020042
43struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
Max9cacb6f2017-02-20 17:22:56 +010044 const char *ip_addr,
45 uint16_t tcp_port,
46 osmo_gsup_read_cb_t read_cb,
47 struct llist_head *lu_op_lst);
Harald Weltee72cf552016-04-28 07:18:49 +020048
49void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
50