blob: 3a2832436abae3547ffb68528f8fa4803d26e7a1 [file] [log] [blame]
Holger Hans Peter Freyther7bdc6372010-02-20 21:21:02 +01001/* MGCP Private Data */
2
3/*
4 * (C) 2009-2010 by Holger Hans Peter Freyther <zecke@selfish.org>
5 * (C) 2009-2010 by On-Waves
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 */
23
24#ifndef OPENBSC_MGCP_DATA_H
25#define OPENBSC_MGCP_DATA_H
26
Holger Hans Peter Freyther1ebad742010-02-26 20:16:37 +010027#include <osmocore/select.h>
Holger Hans Peter Freyther7bdc6372010-02-20 21:21:02 +010028
29#define CI_UNUSED 0
30
31struct mgcp_endpoint {
32 int ci;
33 char *callid;
34 char *local_options;
35 int conn_mode;
36
Holger Hans Peter Freytheref6bb252010-02-26 13:41:22 +010037 int bts_payload_type;
38 int net_payload_type;
39
Holger Hans Peter Freyther7bdc6372010-02-20 21:21:02 +010040 /* the local rtp port we are binding to */
41 int rtp_port;
42
43 /*
44 * RTP mangling:
45 * - we get RTP and RTCP to us and need to forward to the BTS
46 * - we get RTP and RTCP from the BTS and forward to the network
47 */
48 struct bsc_fd local_rtp;
49 struct bsc_fd local_rtcp;
50
51 struct in_addr remote;
52 struct in_addr bts;
53
54 /* in network byte order */
55 int net_rtp, net_rtcp;
56 int bts_rtp, bts_rtcp;
57
58 /* backpointer */
59 struct mgcp_config *cfg;
Holger Hans Peter Freytherb4b135e2010-04-07 09:37:17 +020060
61 /* statistics */
62 unsigned int in_bts;
63 unsigned int in_remote;
Holger Hans Peter Freyther7bdc6372010-02-20 21:21:02 +010064};
65
66#define ENDPOINT_NUMBER(endp) abs(endp - endp->cfg->endpoints)
67
Holger Hans Peter Freytherf2f15912010-04-01 03:27:04 +020068struct mgcp_msg_ptr {
69 unsigned int start;
70 unsigned int length;
71};
72
73int mgcp_analyze_header(struct mgcp_config *cfg, struct msgb *msg,
74 struct mgcp_msg_ptr *ptr, int size,
75 const char **transaction_id, struct mgcp_endpoint **endp);
76
Holger Hans Peter Freyther7bdc6372010-02-20 21:21:02 +010077#endif