nat: Make the write_queue write callback a public function
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 682447a..280fa50 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -298,6 +298,7 @@
 
 int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id);
 int bsc_do_write(struct write_queue *queue, struct msgb *msg, int id);
+int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg);
 
 /* IMSI allow/deny handling */
 void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv);
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index ded05c6..fc8b0a9 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -984,17 +984,6 @@
 	return 0;
 }
 
-static int ipaccess_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;
-}
-
 static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what)
 {
 	struct bsc_connection *bsc;
@@ -1049,7 +1038,7 @@
 	bsc->write_queue.bfd.data = bsc;
 	bsc->write_queue.bfd.fd = fd;
 	bsc->write_queue.read_cb = ipaccess_bsc_read_cb;
-	bsc->write_queue.write_cb = ipaccess_bsc_write_cb;
+	bsc->write_queue.write_cb = bsc_write_cb;
 	bsc->write_queue.bfd.when = BSC_FD_READ;
 	if (bsc_register_fd(&bsc->write_queue.bfd) < 0) {
 		LOGP(DNAT, LOGL_ERROR, "Failed to register BSC fd.\n");
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;
+}
+