blob: 2627d7d660674d323a468f19218e3d265a319f9c [file] [log] [blame]
Holger Hans Peter Freytherd70a7e82011-01-17 14:13:29 +01001/* Run M2UA over SCTP here */
2/* (C) 2011 by Holger Hans Peter Freyther <zecke@selfish.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef sctp_m2ua_h
19#define sctp_m2ua_h
20
21#include "mtp_data.h"
22
23#include <osmocom/m2ua/m2ua_msg.h>
24#include <osmocore/write_queue.h>
25
26#include <netinet/in.h>
27#include <netinet/sctp.h>
28
29struct sctp_m2ua_conn;
30struct mtp_link;
31
32/**
33 * Drive M2UA over a SCTP link. Right now we have no
34 * real concept for failover and such for the link.
35 */
36struct mtp_m2ua_link {
37 struct mtp_link base;
38
39 int started;
40 struct llist_head conns;
41 struct bsc_fd bsc;
42};
43
44/*
45 * One ASP that can be active or such.
46 */
47struct sctp_m2ua_conn {
48 struct llist_head entry;
49 uint8_t asp_ident[4];
50 int asp_up;
51 int asp_active;
52 int established;
53
54 struct write_queue queue;
55 struct mtp_m2ua_link *trans;
56};
57
58struct mtp_m2ua_link *sctp_m2ua_transp_create(const char *ip, int port);
59
60#endif