summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gsmd/usock.h24
-rw-r--r--include/libgsmd/misc.h33
2 files changed, 40 insertions, 17 deletions
diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
index f42a766..b60e28e 100644
--- a/include/gsmd/usock.h
+++ b/include/gsmd/usock.h
@@ -66,7 +66,9 @@ enum gsmd_msg_network {
GSMD_NETWORK_VMAIL_GET = 3,
GSMD_NETWORK_VMAIL_SET = 4,
GSMD_NETWORK_OPER_GET = 5,
- GSMD_NETWORK_CIND_GET = 6,
+ GSMD_NETWORK_OPER_LIST = 6,
+ GSMD_NETWORK_CIND_GET = 7,
+ GSMD_NETWORK_DEREGISTER = 8,
};
enum gsmd_msg_sms {
@@ -358,6 +360,26 @@ struct gsmd_phonebook_support {
u_int8_t tlength;
} __attribute__ ((packed));
+/* Operator status from 3GPP TS 07.07, Clause 7.3 */
+enum gsmd_oper_status {
+ GSMD_OPER_UNKNOWN,
+ GSMD_OPER_AVAILABLE,
+ GSMD_OPER_CURRENT,
+ GSMD_OPER_FORBIDDEN,
+};
+
+/* Theoretically numeric operator code is five digits long but some
+ * operators apparently use six digit codes. */
+typedef char gsmd_oper_numeric[6];
+
+struct gsmd_msg_oper {
+ enum gsmd_oper_status stat;
+ int is_last;
+ char opname_longalpha[16];
+ char opname_shortalpha[8];
+ gsmd_oper_numeric opname_num;
+};
+
struct gsmd_msg_hdr {
u_int8_t version;
u_int8_t msg_type;
diff --git a/include/libgsmd/misc.h b/include/libgsmd/misc.h
index cbc2df0..672b980 100644
--- a/include/libgsmd/misc.h
+++ b/include/libgsmd/misc.h
@@ -10,21 +10,6 @@
extern int lgsm_phone_power(struct lgsm_handle *lh, int power);
-enum lgsm_netreg_state {
- LGSM_NETREG_ST_NOTREG = 0,
- LGSM_NETREG_ST_REG_HOME = 1,
- LGSM_NETREG_ST_NOTREG_SEARCH = 2,
- LGSM_NETREG_ST_DENIED = 3,
- LGSM_NETREG_ST_UNKNOWN = 4,
- LGSM_NETREG_ST_REG_ROAMING = 5,
-};
-
-/* Get the current network registration status */
-extern int lgsm_get_netreg_state(struct lgsm_handle *lh,
- enum lgsm_netreg_state *state);
-
-extern int lgsm_netreg_register(struct lgsm_handle *lh, int oper);
-
enum lgsm_info_type {
LGSM_INFO_TYPE_NONE = 0,
LGSM_INFO_TYPE_MANUF = 1,
@@ -58,8 +43,24 @@ extern int lgsm_voicemail_get(struct lgsm_handle *lh,
struct lgsm_addr *addr);
/* Operator Selection, Network Registration */
-/* TBD */
+extern int lgsm_oper_get(struct lgsm_handle *lh);
+extern int lgsm_opers_get(struct lgsm_handle *lh);
+extern int lgsm_netreg_register(struct lgsm_handle *lh,
+ gsmd_oper_numeric oper);
+extern int lgsm_netreg_deregister(struct lgsm_handle *lh);
+enum lgsm_netreg_state {
+ LGSM_NETREG_ST_NOTREG = 0,
+ LGSM_NETREG_ST_REG_HOME = 1,
+ LGSM_NETREG_ST_NOTREG_SEARCH = 2,
+ LGSM_NETREG_ST_DENIED = 3,
+ LGSM_NETREG_ST_UNKNOWN = 4,
+ LGSM_NETREG_ST_REG_ROAMING = 5,
+};
+
+/* Get the current network registration status */
+extern int lgsm_get_netreg_state(struct lgsm_handle *lh,
+ enum lgsm_netreg_state *state);
/* CLIP, CLIR, COLP, Call Forwarding, Call Waiting, Call Deflecting */
/* TBD */
personal git repositories of Harald Welte. Your mileage may vary