blob: 885fe52c17874b2ae37e05445c02c140ef0b9354 [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;
Harald Weltee72cf552016-04-28 07:18:49 +020034};
35
36
37int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg);
Neels Hofmeyr6eed3222016-12-11 01:21:49 +010038int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr,
39 uint8_t tag);
Harald Weltee72cf552016-04-28 07:18:49 +020040
41struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
Max9cacb6f2017-02-20 17:22:56 +010042 const char *ip_addr,
43 uint16_t tcp_port,
44 osmo_gsup_read_cb_t read_cb,
45 struct llist_head *lu_op_lst);
Harald Weltee72cf552016-04-28 07:18:49 +020046
47void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
48