blob: bf1a570d3679cad5b4b7c68abd16ef6ae072dcf7 [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);
35
36struct osmo_gsup_server *osmo_gsup_server_create(void *ctx,
37 const char *ip_addr,
38 uint16_t tcp_port,
39 osmo_gsup_read_cb_t read_cb);
40
41void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
42