nat: Make the write_queue write callback a public function
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 9c155cc..a458afd 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -40,6 +40,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <unistd.h>
static const struct rate_ctr_desc bsc_cfg_ctr_description[] = {
[BCFG_CTR_SCCP_CONN] = { "sccp.conn", "SCCP Connections "},
@@ -674,3 +675,15 @@
{
return con_to_ctr[conn->con_type];
}
+
+int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg)
+{
+ int rc;
+
+ rc = write(bfd->fd, msg->data, msg->len);
+ if (rc != msg->len)
+ LOGP(DNAT, LOGL_ERROR, "Failed to write message to the BSC.\n");
+
+ return rc;
+}
+