blob: d068e5f02de12de3e29ed11e29a85c06ef2a8226 [file] [log] [blame]
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +08001/* Patch Messages to and from the MSC */
2/*
3 * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * (C) 2010 by On-Waves
5 * All Rights Reserved
6 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +01007 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080010 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010015 * GNU Affero General Public License for more details.
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080016 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010017 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080019 *
20 */
21#ifndef bss_patch_h
22#define bss_patch_h
23
Holger Hans Peter Freythercbf7d182010-07-31 05:25:35 +080024#include <osmocore/msgb.h>
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080025
Holger Hans Peter Freythercf381e22010-08-04 18:39:26 +080026#include <osmocom/sccp/sccp.h>
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080027
28#define BSS_FILTER_RESET 1
29#define BSS_FILTER_RESET_ACK 2
30#define BSS_FILTER_RLSD 3
31#define BSS_FILTER_RLC 4
32#define BSS_FILTER_CLEAR_COMPL 5
33
34/**
35 * Error is < 0
36 * Success is == 0
37 * Filter is > 0
38 */
39int bss_patch_filter_msg(struct msgb *msg, struct sccp_parse_result *result);
40
41/*
42 * Copy inpt->l2h to target->l2h but rewrite the SCCP header on the way
43 */
44void bss_rewrite_header_for_msc(int, struct msgb *target, struct msgb *inpt, struct sccp_parse_result *result);
45int bss_rewrite_header_to_bsc(struct msgb *target, int opc, int dpc);
46
47#endif