diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-02-07 14:57:06 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-02-08 13:44:48 +0100 |
commit | be807e4250dfcde9ad65508ce10647487694f6b3 (patch) | |
tree | 89683855830c7a7836a9877e5f2ab44b086ea866 /openbsc/include/openbsc/bsc_nat.h | |
parent | 71ddbf5c4f75b361c04d37e0de5514fe7f390496 (diff) |
[nat] Add VTY support to the BSC nat application
* Create struct bsc_nat and move the various lists into this structure
* Create the VTY code
* Call the VTY init and parsing code
* Create functions to create the types..
* Add some stuff into the bsc_connection to be used for the NAT with
proper config files. E.g. to close the connection if the BSC does not
respond to a given command.
Diffstat (limited to 'openbsc/include/openbsc/bsc_nat.h')
-rw-r--r-- | openbsc/include/openbsc/bsc_nat.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index cfd6a8a34..66acde504 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -27,6 +27,7 @@ #include "select.h" #include "msgb.h" +#include "timer.h" #define DIR_BSC 1 #define DIR_MSC 2 @@ -75,6 +76,12 @@ struct bsc_connection { /* the fd we use to communicate */ struct bsc_fd bsc_fd; + + /* the LAC assigned to this connection */ + unsigned int lac; + + /* a timeout node */ + struct timer_list id_timeout; }; /* @@ -91,6 +98,38 @@ struct sccp_connections { struct sccp_source_reference patched_ref; }; +/** + * One BSC entry in the config + */ +struct bsc_config { + struct llist_head entry; + + char *token; + unsigned int lac; + int nr; + + struct bsc_nat *nat; +}; + +/** + * the structure of the "nat" network + */ +struct bsc_nat { + /* active SCCP connections that need patching */ + struct llist_head sccp_connections; + + /* active BSC connections that need patching */ + struct llist_head bsc_connections; + + /* known BSC's */ + struct llist_head bsc_configs; + int num_bsc; +}; + +/* create and init the structures */ +struct bsc_config *bsc_config_alloc(struct bsc_nat *nat, const char *token, unsigned int lac); +struct bsc_config *bsc_config_num(struct bsc_nat *nat, int num); + /** * parse the given message into the above structure @@ -101,5 +140,6 @@ struct bsc_nat_parsed *bsc_nat_parse(struct msgb *msg); * filter based on IP Access header in both directions */ int bsc_nat_filter_ipa(int direction, struct msgb *msg, struct bsc_nat_parsed *parsed); +int bsc_nat_vty_init(struct bsc_nat *nat); #endif |