blob: 0571099c643a710fc0df1d7d5cd8fdecc9861b88 [file] [log] [blame]
Holger Hans Peter Freyther85d3b342013-06-14 19:10:28 +02001/*
2 * (C) 2013 by On-Waves
3 * (C) 2013 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20#ifndef NAT_REWRITE_FILE_H
21#define NAT_REWRITE_FILE_H
22
23#include <osmocom/core/linuxrbtree.h>
24
Holger Hans Peter Freytherddf191e2013-06-25 11:44:01 +020025struct vty;
26
Holger Hans Peter Freyther85d3b342013-06-14 19:10:28 +020027struct nat_rewrite_rule {
28 /* For digits 0-9 and + */
29 struct nat_rewrite_rule *rules[11];
30
31 char empty;
32 char prefix[14];
Holger Hans Peter Freytherddf191e2013-06-25 11:44:01 +020033 char rewrite[6];
Holger Hans Peter Freyther85d3b342013-06-14 19:10:28 +020034};
35
36struct nat_rewrite {
37 struct nat_rewrite_rule rule;
38 size_t prefixes;
39};
40
41
42struct nat_rewrite *nat_rewrite_parse(void *ctx, const char *filename);
43struct nat_rewrite_rule *nat_rewrite_lookup(struct nat_rewrite *, const char *prefix);
44void nat_rewrite_dump(struct nat_rewrite *rewr);
Holger Hans Peter Freytherddf191e2013-06-25 11:44:01 +020045void nat_rewrite_dump_vty(struct vty *vty, struct nat_rewrite *rewr);
Holger Hans Peter Freyther85d3b342013-06-14 19:10:28 +020046
47#endif