diff include/number_db_v2.h @ 0:159dd90eeafe

beginning, libnumutil compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 12 Dec 2023 23:52:50 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/number_db_v2.h	Tue Dec 12 23:52:50 2023 +0000
@@ -0,0 +1,40 @@
+/*
+ * This header file defines version 2 of ThemWi number database
+ * binary file format.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+struct numdb_file_hdr {
+	uint32_t	owned_number_count;
+	uint32_t	short_number_count;
+};
+
+struct owned_number_rec {
+	uint16_t	number[3];	/* NPA-exchange-suffix breakdown */
+	uint8_t		number_flags;	/* properties of outside number */
+	uint8_t		usage;		/* usage inside ThemWi */
+	uint16_t	remap[3];	/* secondary remap number */
+};
+
+#define	NUMBER_FLAG_SMSPROV	0x01	/* provisioned for outside SMS */
+#define	NUMBER_FLAG_E911PROV	0x02	/* provisioned for E911 */
+
+#define	NUMBER_USAGE_MASK		0x0F
+#define	NUMBER_USAGE_TYPE_RSVD		0x00
+#define	NUMBER_USAGE_TYPE_GSM_SUB	0x01
+#define	NUMBER_USAGE_TYPE_ALIAS		0x02
+#define	NUMBER_USAGE_FLAG_E911_VIA	0x10
+
+struct short_number_rec {
+	uint16_t	short_num;
+	uint8_t		short_num_type;
+	uint8_t		fullnum_flags;
+	uint16_t	fullnum_prefix[2];
+};
+
+#define	SHORT_NUM_TYPE_ABBREV		0x01
+#define	SHORT_NUM_TYPE_ITN		0x02
+#define	SHORT_NUM_TYPE_TEST_SINK	0x03