aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-05-06 12:09:47 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2011-05-06 12:12:49 +0200
commite1273b1f3c2c1bf44a2b8c274b880370d6de25cf (patch)
treeb4dd1c319e13c4c489a701f4495d3e435735b91b /openbsc/src
parentbbc5b99a6bf9f02ac65937e566287651bcd3269f (diff)
src: use namespace prefix osmo_wqueue*
Summary of changes: s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libbsc/bsc_msc.c14
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_msc.c6
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_rf.c6
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c6
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c4
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat_utils.c8
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_ussd.c4
7 files changed, 24 insertions, 24 deletions
diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c
index a46f4b98..e9ffce39 100644
--- a/openbsc/src/libbsc/bsc_msc.c
+++ b/openbsc/src/libbsc/bsc_msc.c
@@ -42,7 +42,7 @@ static void connection_loss(struct bsc_msc_connection *con)
close(fd->fd);
fd->fd = -1;
- fd->cb = write_queue_bfd_cb;
+ fd->cb = osmo_wqueue_bfd_cb;
fd->when = 0;
con->is_connected = 0;
@@ -64,7 +64,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
int rc;
int val;
struct bsc_msc_connection *con;
- struct write_queue *queue;
+ struct osmo_wqueue *queue;
socklen_t len = sizeof(val);
@@ -73,7 +73,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
return -1;
}
- queue = container_of(fd, struct write_queue, bfd);
+ queue = container_of(fd, struct osmo_wqueue, bfd);
con = container_of(queue, struct bsc_msc_connection, write_queue);
/* From here on we will either be connected or reconnect */
@@ -92,7 +92,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
/* go to full operation */
- fd->cb = write_queue_bfd_cb;
+ fd->cb = osmo_wqueue_bfd_cb;
fd->when = BSC_FD_READ | BSC_FD_EXCEPT;
con->is_connected = 1;
@@ -191,7 +191,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con)
return ret;
} else {
fd->when = BSC_FD_READ | BSC_FD_EXCEPT;
- fd->cb = write_queue_bfd_cb;
+ fd->cb = osmo_wqueue_bfd_cb;
con->is_connected = 1;
if (con->connected)
con->connected(con);
@@ -219,13 +219,13 @@ struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dests)
con->dests = dests;
con->write_queue.bfd.fd = -1;
- write_queue_init(&con->write_queue, 100);
+ osmo_wqueue_init(&con->write_queue, 100);
return con;
}
void bsc_msc_lost(struct bsc_msc_connection *con)
{
- write_queue_clear(&con->write_queue);
+ osmo_wqueue_clear(&con->write_queue);
osmo_timer_del(&con->timeout_timer);
if (con->write_queue.bfd.fd >= 0)
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
index b4fedede..6ea8c4f5 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
@@ -102,7 +102,7 @@ static void mgcp_forward(struct osmo_msc_data *data, struct msgb *msg)
msgb_put(mgcp, msgb_l2len(msg));
memcpy(mgcp->data, msg->l2h, mgcp->len);
- if (write_queue_enqueue(&data->mgcp_agent, mgcp) != 0) {
+ if (osmo_wqueue_enqueue(&data->mgcp_agent, mgcp) != 0) {
LOGP(DMGCP, LOGL_FATAL, "Could not queue message to MGCP GW.\n");
msgb_free(mgcp);
}
@@ -144,7 +144,7 @@ static int mgcp_create_port(struct osmo_msc_data *data)
return -1;
}
- write_queue_init(&data->mgcp_agent, 10);
+ osmo_wqueue_init(&data->mgcp_agent, 10);
data->mgcp_agent.bfd.when = BSC_FD_READ;
data->mgcp_agent.bfd.data = data;
data->mgcp_agent.read_cb = mgcp_do_read;
@@ -166,7 +166,7 @@ static int mgcp_create_port(struct osmo_msc_data *data)
int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto)
{
ipaccess_prepend_header(msg, proto);
- if (write_queue_enqueue(&conn->write_queue, msg) != 0) {
+ if (osmo_wqueue_enqueue(&conn->write_queue, msg) != 0) {
LOGP(DMSC, LOGL_FATAL, "Failed to queue IPA/%d\n", proto);
msgb_free(msg);
return -1;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c
index 78550d79..11cdffe8 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c
@@ -69,7 +69,7 @@ static void send_resp(struct osmo_bsc_rf_conn *conn, char send)
msg->l2h = msgb_put(msg, 1);
msg->l2h[0] = send;
- if (write_queue_enqueue(&conn->queue, msg) != 0) {
+ if (osmo_wqueue_enqueue(&conn->queue, msg) != 0) {
LOGP(DINP, LOGL_ERROR, "Failed to enqueue the answer.\n");
msgb_free(msg);
return;
@@ -205,7 +205,7 @@ static int rf_read_cmd(struct osmo_fd *fd)
LOGP(DINP, LOGL_ERROR, "Short read %d/%s\n", errno, strerror(errno));
osmo_fd_unregister(fd);
close(fd->fd);
- write_queue_clear(&conn->queue);
+ osmo_wqueue_clear(&conn->queue);
talloc_free(conn);
return -1;
}
@@ -265,7 +265,7 @@ static int rf_ctl_accept(struct osmo_fd *bfd, unsigned int what)
return -1;
}
- write_queue_init(&conn->queue, 10);
+ osmo_wqueue_init(&conn->queue, 10);
conn->queue.bfd.data = conn;
conn->queue.bfd.fd = fd;
conn->queue.bfd.when = BSC_FD_READ | BSC_FD_WRITE;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index be2666de..9ac54dab 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -478,7 +478,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
return;
}
- if (write_queue_enqueue(&bsc->nat->mgcp_cfg->gw_fd, output) != 0) {
+ if (osmo_wqueue_enqueue(&bsc->nat->mgcp_cfg->gw_fd, output) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to queue MGCP msg.\n");
msgb_free(output);
}
@@ -628,7 +628,7 @@ static int mgcp_do_read(struct osmo_fd *fd)
/* we do have a direct answer... e.g. AUEP */
if (resp) {
- if (write_queue_enqueue(&nat->mgcp_cfg->gw_fd, resp) != 0) {
+ if (osmo_wqueue_enqueue(&nat->mgcp_cfg->gw_fd, resp) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to enqueue msg.\n");
msgb_free(resp);
}
@@ -698,7 +698,7 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat)
return -1;
}
- write_queue_init(&cfg->gw_fd, 10);
+ osmo_wqueue_init(&cfg->gw_fd, 10);
cfg->gw_fd.bfd.when = BSC_FD_READ;
cfg->gw_fd.bfd.data = nat;
cfg->gw_fd.read_cb = mgcp_do_read;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 0fb58436..f732488d 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -100,7 +100,7 @@ static void queue_for_msc(struct bsc_msc_connection *con, struct msgb *msg)
}
- if (write_queue_enqueue(&con->write_queue, msg) != 0) {
+ if (osmo_wqueue_enqueue(&con->write_queue, msg) != 0) {
LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n");
msgb_free(msg);
}
@@ -877,7 +877,7 @@ void bsc_close_connection(struct bsc_connection *connection)
osmo_fd_unregister(&connection->write_queue.bfd);
close(connection->write_queue.bfd.fd);
- write_queue_clear(&connection->write_queue);
+ osmo_wqueue_clear(&connection->write_queue);
llist_del(&connection->list_entry);
talloc_free(connection);
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
index e796b2b8..4f90cdf9 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
@@ -124,7 +124,7 @@ struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat)
return NULL;
con->nat = nat;
- write_queue_init(&con->write_queue, 100);
+ osmo_wqueue_init(&con->write_queue, 100);
return con;
}
@@ -335,16 +335,16 @@ int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int proto)
return bsc_do_write(&bsc->write_queue, msg, proto);
}
-int bsc_do_write(struct write_queue *queue, struct msgb *msg, int proto)
+int bsc_do_write(struct osmo_wqueue *queue, struct msgb *msg, int proto)
{
/* prepend the header */
ipaccess_prepend_header(msg, proto);
return bsc_write_msg(queue, msg);
}
-int bsc_write_msg(struct write_queue *queue, struct msgb *msg)
+int bsc_write_msg(struct osmo_wqueue *queue, struct msgb *msg)
{
- if (write_queue_enqueue(queue, msg) != 0) {
+ if (osmo_wqueue_enqueue(queue, msg) != 0) {
LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n");
msgb_free(msg);
return -1;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index 910ef407..69cb7a41 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -60,7 +60,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con)
close(con->queue.bfd.fd);
osmo_fd_unregister(&con->queue.bfd);
osmo_timer_del(&con->auth_timeout);
- write_queue_clear(&con->queue);
+ osmo_wqueue_clear(&con->queue);
talloc_free(con);
}
@@ -218,7 +218,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what)
return -1;
}
- write_queue_init(&conn->queue, 10);
+ osmo_wqueue_init(&conn->queue, 10);
conn->queue.bfd.data = conn;
conn->queue.bfd.fd = fd;
conn->queue.bfd.when = BSC_FD_READ;