blob: 390bf2eb29b6e6ec02b94e16e24b62eb01c89811 [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;
19};
20
21
22/* a single connection to a given client (SGSN, MSC) */
23struct osmo_gsup_conn {
24 struct llist_head list;
25
26 struct osmo_gsup_server *server;
27 struct ipa_server_conn *conn;
28 //struct oap_state oap_state;
29};
30
31
32int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg);
33
34struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
35 const char *ip_addr,
36 uint16_t tcp_port,
37 osmo_gsup_read_cb_t read_cb);
38
39void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
40