diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-05-09 16:01:49 +0000 |
---|---|---|
committer | Andreas.Eversberg <jolly@eversberg.eu> | 2010-05-09 16:01:49 +0000 |
commit | 3928d757f043f493be4370e290803771b35d73b1 (patch) | |
tree | 6b9c34dd7e9919c740b29dfa7f8c647e8acb8d7e /src/host/layer23/include/osmocom | |
parent | acd570fff8ba3b7e378e690eb41acb68f107677f (diff) |
Added vty interface (taken from OpenBSC project).
It is now possible to show informations about:
- mobile
- subscriber
- received cell informations
Later it can be used to do configurations (phone's menu)
and trigger events, like dialing a phone number.
Diffstat (limited to 'src/host/layer23/include/osmocom')
-rw-r--r-- | src/host/layer23/include/osmocom/file.h | 1 | ||||
-rwxr-xr-x | src/host/layer23/include/osmocom/gsm322.h | 10 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/osmocom_data.h | 1 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/subscriber.h | 8 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/support.h | 4 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/sysinfo.h | 3 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/telnet_interface.h | 42 |
7 files changed, 60 insertions, 9 deletions
diff --git a/src/host/layer23/include/osmocom/file.h b/src/host/layer23/include/osmocom/file.h index 3e06740e..289347d9 100644 --- a/src/host/layer23/include/osmocom/file.h +++ b/src/host/layer23/include/osmocom/file.h @@ -26,6 +26,7 @@ static inline OSMOCOM_FILE *osmocom_fopen(const char *name, const char *mode) return fopen(filename, mode); } #define osmocom_fread fread +#define osmocom_fgets fgets #define osmocom_fwrite fwrite #define osmocom_feof feof #define osmocom_fclose fclose diff --git a/src/host/layer23/include/osmocom/gsm322.h b/src/host/layer23/include/osmocom/gsm322.h index a6e9a75a..c6828be6 100755 --- a/src/host/layer23/include/osmocom/gsm322.h +++ b/src/host/layer23/include/osmocom/gsm322.h @@ -177,21 +177,15 @@ int gsm322_cs_sendmsg(struct osmocom_ms *ms, struct msgb *msg); int gsm322_c_event(struct osmocom_ms *ms, struct msgb *msg); int gsm322_plmn_dequeue(struct osmocom_ms *ms); int gsm322_cs_dequeue(struct osmocom_ms *ms); -int gsm322_add_forbidden_plmn(struct osmocom_ms *ms, uint16_t mcc, - uint16_t mnc, uint8_t cause); int gsm322_add_forbidden_la(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, uint16_t lac, uint8_t cause); -int gsm322_del_forbidden_plmn(struct osmocom_ms *ms, uint16_t mcc, - uint16_t mnc); int gsm322_del_forbidden_la(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, uint16_t lac); -int gsm322_is_forbidden_plmn(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc); int gsm322_is_forbidden_la(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc, uint16_t lac); int gsm322_dump_sorted_plmn(struct osmocom_ms *ms); -int gsm322_dump_cs_list(struct osmocom_ms *ms, uint8_t flag); -int gsm322_dump_sim_plmn(struct osmocom_ms *ms); -int gsm322_dump_forbidden_plmn(struct osmocom_ms *ms); +int gsm322_dump_cs_list(struct gsm322_cellsel *cs, uint8_t flags, + void (*print)(void *, const char *, ...), void *priv); int gsm322_dump_forbidden_la(struct osmocom_ms *ms); void start_cs_timer(struct gsm322_cellsel *cs, int sec, int micro); void start_loss_timer(struct gsm322_cellsel *cs, int sec, int micro); diff --git a/src/host/layer23/include/osmocom/osmocom_data.h b/src/host/layer23/include/osmocom/osmocom_data.h index bf34d546..f56ba288 100644 --- a/src/host/layer23/include/osmocom/osmocom_data.h +++ b/src/host/layer23/include/osmocom/osmocom_data.h @@ -25,6 +25,7 @@ struct osmol2_entity { /* One Mobilestation for osmocom */ struct osmocom_ms { + struct llist_head entity; char name[32]; struct write_queue wq; uint16_t test_arfcn; diff --git a/src/host/layer23/include/osmocom/subscriber.h b/src/host/layer23/include/osmocom/subscriber.h index 7f0e3358..0091cb27 100644 --- a/src/host/layer23/include/osmocom/subscriber.h +++ b/src/host/layer23/include/osmocom/subscriber.h @@ -68,6 +68,14 @@ int gsm_subscr_exit(struct osmocom_ms *ms); int gsm_subscr_testcard(struct osmocom_ms *ms, int mcc, int mnc, char *msin); int gsm_subscr_remove(struct osmocom_ms *ms); void new_sim_ustate(struct gsm_subscriber *subscr, int state); +int gsm_subscr_del_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc); +int gsm_subscr_add_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc, uint8_t cause); +int gsm_subscr_is_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc); +void gsm_subscr_dump(struct gsm_subscriber *subscr, + void (*print)(void *, const char *, ...), void *priv); #endif /* _SUBSCRIBER_H */ diff --git a/src/host/layer23/include/osmocom/support.h b/src/host/layer23/include/osmocom/support.h index 7b8f7cd0..1a4fa9a3 100644 --- a/src/host/layer23/include/osmocom/support.h +++ b/src/host/layer23/include/osmocom/support.h @@ -11,6 +11,8 @@ #define GSM_CIPHER_RESERVED 7 struct gsm_support { + struct osmocom_ms *ms; + /* rf power capability */ uint8_t pwr_lev_900; /* and < 900 */ uint8_t pwr_lev_1800; /* DCS and PCS */ @@ -88,6 +90,8 @@ struct gsm_support_scan_max { extern struct gsm_support_scan_max gsm_sup_smax[]; void gsm_support_init(struct osmocom_ms *ms); +void gsm_support_dump(struct gsm_support *sup, + void (*print)(void *, const char *, ...), void *priv); #endif /* _SUPPORT_H */ diff --git a/src/host/layer23/include/osmocom/sysinfo.h b/src/host/layer23/include/osmocom/sysinfo.h index cc732839..0725305e 100644 --- a/src/host/layer23/include/osmocom/sysinfo.h +++ b/src/host/layer23/include/osmocom/sysinfo.h @@ -114,6 +114,7 @@ struct gsm48_sysinfo { uint16_t nb_class_barr; /* bit 10 is emergency */ }; -int gsm48_sysinfo_dump(struct osmocom_ms *ms, struct gsm48_sysinfo *s); +int gsm48_sysinfo_dump(struct gsm48_sysinfo *s, + void (*print)(void *, const char *, ...), void *priv); #endif /* _SYSINFO_H */ diff --git a/src/host/layer23/include/osmocom/telnet_interface.h b/src/host/layer23/include/osmocom/telnet_interface.h new file mode 100644 index 00000000..f5216938 --- /dev/null +++ b/src/host/layer23/include/osmocom/telnet_interface.h @@ -0,0 +1,42 @@ +/* minimalistic telnet/network interface it might turn into a wire interface */ +/* (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org> + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef TELNET_INTERFACE_H +#define TELNET_INTERFACE_H + +#include <osmocom/osmocom_data.h> +#include <osmocore/select.h> + +#include <vty/vty.h> + +struct telnet_connection { + struct llist_head entry; + struct osmocom_ms *ms; + struct bsc_fd fd; + struct vty *vty; + struct debug_target *dbg; +}; + + +extern int telnet_init(struct osmocom_ms *ms, int port); + +extern int ms_vty_init(struct osmocom_ms *ms); + +#endif |