changeset 30:496f359226ab

include: constant and interface headers for themwi-mgw
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 06 Jul 2022 22:26:09 -0800
parents dffcae9bc8a3
children 08d7794cdd0a
files include/tmgw_const.h include/tmgw_ctrl.h
diffstat 2 files changed, 63 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/tmgw_const.h	Wed Jul 06 22:26:09 2022 -0800
@@ -0,0 +1,25 @@
+/*
+ * This header file defines some constants for themwi-mgw,
+ * used in the implementation, in the control interface and
+ * throughout the architecture.
+ */
+
+#define	TMGW_EP_TYPE_DUMMY_GSM		1
+#define	TMGW_EP_TYPE_DUMMY_PSTN		2
+#define	TMGW_EP_TYPE_GATEWAY		3
+
+#define	TMGW_EP_HAS_GSM_SOCK		1
+#define	TMGW_EP_HAS_PSTN_SOCK		2
+
+#define	TMGW_FWD_MODE_INACTIVE		0
+#define	TMGW_FWD_MODE_RECVONLY		1
+#define	TMGW_FWD_MODE_SENDONLY		2
+#define	TMGW_FWD_MODE_SENDRECV		3
+
+#define	GSM_TCHF_FRAME			0x0300
+#define	GSM_TCHF_FRAME_EFR		0x0301
+#define	GSM_TCHH_FRAME			0x0302
+#define	GSM_TCH_FRAME_AMR		0x0303
+
+#define	PSTN_CODEC_PCMU			0
+#define	PSTN_CODEC_PCMA			8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/tmgw_ctrl.h	Wed Jul 06 22:26:09 2022 -0800
@@ -0,0 +1,38 @@
+/*
+ * This header file defines the ad hoc control interface
+ * to themwi-mgw over a dedicated local socket.
+ */
+
+struct tmgw_ctrl_req {
+	uint32_t	opcode;
+	uint32_t	transact_ref;
+	uint32_t	ep_id;
+	uint32_t	setup_mask;
+	struct sockaddr_storage gsm_addr;
+	uint32_t	gsm_payload_type;
+	uint32_t	gsm_payload_msg_type;
+	struct sockaddr_storage pstn_addr;
+	uint32_t	pstn_payload_type;
+	uint32_t	fwd_mode;
+};
+
+#define	TMGW_CTRL_OP_CRCX		1
+#define	TMGW_CTRL_OP_MDCX		2
+#define	TMGW_CTRL_OP_DLCX		3
+
+#define	TMGW_CTRL_MASK_GSM_CONN		0x0001
+#define	TMGW_CTRL_MASK_PSTN_CONN	0x0002
+#define	TMGW_CTRL_MASK_FWD_MODE		0x0004
+
+struct tmgw_ctrl_resp {
+	uint32_t	transact_ref;
+	uint32_t	res;
+	uint32_t	ep_id;
+	struct sockaddr_storage gsm_addr;
+	struct sockaddr_storage pstn_addr;
+};
+
+#define	TMGW_RESP_OK		0
+#define	TMGW_RESP_ERR_PROT	1
+#define	TMGW_RESP_ERR_RSRC	2
+#define	TMGW_RESP_ERR_UNKNOWN	3