blob: 484a0d7566423d80c71fcd69ee148e7c9d0df5fc [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
17 struct ipa_server_link *link;
18 osmo_gsup_read_cb_t read_cb;
Harald Weltee687be52016-05-03 18:49:27 +020019 struct llist_head routes;
Harald Weltee72cf552016-04-28 07:18:49 +020020};
21
22
23/* a single connection to a given client (SGSN, MSC) */
24struct osmo_gsup_conn {
25 struct llist_head list;
26
27 struct osmo_gsup_server *server;
28 struct ipa_server_conn *conn;
29 //struct oap_state oap_state;
Harald Weltee687be52016-05-03 18:49:27 +020030 struct tlv_parsed ccm;
Harald Weltee72cf552016-04-28 07:18:49 +020031};
32
33
34int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg);
Neels Hofmeyr6eed3222016-12-11 01:21:49 +010035int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr,
36 uint8_t tag);
Harald Weltee72cf552016-04-28 07:18:49 +020037
38struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
39 const char *ip_addr,
40 uint16_t tcp_port,
41 osmo_gsup_read_cb_t read_cb);
42
43void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
44