summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/libbsc/bsc_msc.c8
-rw-r--r--openbsc/src/libbsc/bsc_rf_ctrl.c4
-rw-r--r--openbsc/src/libbsc/pcu_sock.c18
-rw-r--r--openbsc/src/libcommon/socket.c2
-rw-r--r--openbsc/src/libmgcp/mgcp_network.c4
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c2
-rw-r--r--openbsc/src/libmsc/meas_feed.c4
-rw-r--r--openbsc/src/libmsc/mncc_sock.c20
-rw-r--r--openbsc/src/libmsc/smpp_smsc.c2
-rw-r--r--openbsc/src/libtrau/rtp_proxy.c18
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_msc.c2
-rw-r--r--openbsc/src/osmo-bsc_mgcp/mgcp_main.c2
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c2
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c4
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_ussd.c4
15 files changed, 48 insertions, 48 deletions
diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c
index 82a572dbe..dac0e5203 100644
--- a/openbsc/src/libbsc/bsc_msc.c
+++ b/openbsc/src/libbsc/bsc_msc.c
@@ -81,7 +81,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
queue = container_of(fd, struct osmo_wqueue, bfd);
con = container_of(queue, struct bsc_msc_connection, write_queue);
- if ((what & BSC_FD_WRITE) == 0) {
+ if ((what & OSMO_FD_WRITE) == 0) {
LOGP(DMSC, LOGL_ERROR,
"MSC(%s) Callback but not writable.\n", con->name);
return -1;
@@ -107,7 +107,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what)
/* go to full operation */
fd->cb = osmo_wqueue_bfd_cb;
- fd->when = BSC_FD_READ | BSC_FD_EXCEPT;
+ fd->when = OSMO_FD_READ | OSMO_FD_EXCEPT;
con->is_connected = 1;
LOGP(DMSC, LOGL_NOTICE,
@@ -209,7 +209,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con)
if (ret == -1 && errno == EINPROGRESS) {
LOGP(DMSC, LOGL_ERROR,
"MSC(%s) Connection in progress\n", con->name);
- fd->when = BSC_FD_WRITE;
+ fd->when = OSMO_FD_WRITE;
fd->cb = msc_connection_connect;
osmo_timer_setup(&con->timeout_timer, msc_con_timeout, con);
osmo_timer_schedule(&con->timeout_timer, 20, 0);
@@ -218,7 +218,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con)
connection_loss(con);
return ret;
} else {
- fd->when = BSC_FD_READ | BSC_FD_EXCEPT;
+ fd->when = OSMO_FD_READ | OSMO_FD_EXCEPT;
fd->cb = osmo_wqueue_bfd_cb;
con->is_connected = 1;
if (con->connected)
diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c
index 0e28600b5..9159a8f76 100644
--- a/openbsc/src/libbsc/bsc_rf_ctrl.c
+++ b/openbsc/src/libbsc/bsc_rf_ctrl.c
@@ -373,7 +373,7 @@ static int rf_ctrl_accept(struct osmo_fd *bfd, unsigned int what)
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;
+ conn->queue.bfd.when = OSMO_FD_READ | OSMO_FD_WRITE;
conn->queue.read_cb = rf_read_cmd;
conn->queue.write_cb = rf_write_cmd;
conn->rf = rf;
@@ -479,7 +479,7 @@ static int rf_create_socket(struct osmo_bsc_rf *rf, const char *path)
return -1;
}
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->cb = rf_ctrl_accept;
bfd->data = rf;
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index e2066ba3e..4411df84a 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -484,7 +484,7 @@ static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg)
return -EIO;
}
msgb_enqueue(&state->upqueue, msg);
- conn_bfd->when |= BSC_FD_WRITE;
+ conn_bfd->when |= OSMO_FD_WRITE;
return 0;
}
@@ -507,7 +507,7 @@ static void pcu_sock_close(struct pcu_sock_state *state)
osmo_fd_unregister(bfd);
/* re-enable the generation of ACCEPT for new connections */
- state->listen_bfd.when |= BSC_FD_READ;
+ state->listen_bfd.when |= OSMO_FD_READ;
#if 0
/* remove si13, ... */
@@ -586,7 +586,7 @@ static int pcu_sock_write(struct osmo_fd *bfd)
msg = llist_entry(state->upqueue.next, struct msgb, list);
pcu_prim = (struct gsm_pcu_if *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -601,7 +601,7 @@ static int pcu_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -625,12 +625,12 @@ static int pcu_sock_cb(struct osmo_fd *bfd, unsigned int flags)
{
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = pcu_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = pcu_sock_write(bfd);
return rc;
@@ -656,13 +656,13 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags)
LOGP(DPCU, LOGL_NOTICE, "PCU connects but we already have "
"another active connection ?!?\n");
/* We already have one PCU connected, this is all we support */
- state->listen_bfd.when &= ~BSC_FD_READ;
+ state->listen_bfd.when &= ~OSMO_FD_READ;
close(rc);
return 0;
}
conn_bfd->fd = rc;
- conn_bfd->when = BSC_FD_READ;
+ conn_bfd->when = OSMO_FD_READ;
conn_bfd->cb = pcu_sock_cb;
conn_bfd->data = state;
@@ -705,7 +705,7 @@ int pcu_sock_init(const char *path, struct gsm_bts *bts)
return -1;
}
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->cb = pcu_sock_accept;
bfd->data = state;
diff --git a/openbsc/src/libcommon/socket.c b/openbsc/src/libcommon/socket.c
index 2a64767f8..5697c3367 100644
--- a/openbsc/src/libcommon/socket.c
+++ b/openbsc/src/libcommon/socket.c
@@ -65,7 +65,7 @@ int make_sock(struct osmo_fd *bfd, int proto,
bfd->fd = socket(AF_INET, type, proto);
bfd->cb = cb;
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->data = data;
bfd->priv_nr = priv_nr;
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 49500d92c..e2686587d 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -972,14 +972,14 @@ static int bind_rtp(struct mgcp_config *cfg, const char *source_addr,
mgcp_set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp);
mgcp_set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp);
- rtp_end->rtp.when = BSC_FD_READ;
+ rtp_end->rtp.when = OSMO_FD_READ;
if (osmo_fd_register(&rtp_end->rtp) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to register RTP port %d on 0x%x\n",
rtp_end->local_port, endpno);
goto cleanup2;
}
- rtp_end->rtcp.when = BSC_FD_READ;
+ rtp_end->rtcp.when = OSMO_FD_READ;
if (osmo_fd_register(&rtp_end->rtcp) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Failed to register RTCP port %d on 0x%x\n",
rtp_end->local_port + 1, endpno);
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index ce344ca7b..232c23ad6 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -445,7 +445,7 @@ int osmux_init(int role, struct mgcp_config *cfg)
return ret;
}
mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp);
- osmux_fd.when |= BSC_FD_READ;
+ osmux_fd.when |= OSMO_FD_READ;
ret = osmo_fd_register(&osmux_fd);
if (ret < 0) {
diff --git a/openbsc/src/libmsc/meas_feed.c b/openbsc/src/libmsc/meas_feed.c
index 3ddcdc39c..64134934c 100644
--- a/openbsc/src/libmsc/meas_feed.c
+++ b/openbsc/src/libmsc/meas_feed.c
@@ -101,7 +101,7 @@ static int feed_read_cb(struct osmo_fd *ofd)
char buf[256];
rc = read(ofd->fd, buf, sizeof(buf));
- ofd->fd &= ~BSC_FD_READ;
+ ofd->fd &= ~OSMO_FD_READ;
return rc;
}
@@ -140,7 +140,7 @@ int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port)
if (rc < 0)
return rc;
- g_mfs.wqueue.bfd.when &= ~BSC_FD_READ;
+ g_mfs.wqueue.bfd.when &= ~OSMO_FD_READ;
if (g_mfs.dst_host)
talloc_free(g_mfs.dst_host);
diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c
index 0efe3a156..98cafa16c 100644
--- a/openbsc/src/libmsc/mncc_sock.c
+++ b/openbsc/src/libmsc/mncc_sock.c
@@ -73,7 +73,7 @@ int mncc_sock_from_cc(struct gsm_network *net, struct msgb *msg)
/* Actually enqueue the message and mark socket write need */
msgb_enqueue(&net->upqueue, msg);
- net->mncc_state->conn_bfd.when |= BSC_FD_WRITE;
+ net->mncc_state->conn_bfd.when |= OSMO_FD_WRITE;
return 0;
}
@@ -88,7 +88,7 @@ static void mncc_sock_close(struct mncc_sock_state *state)
osmo_fd_unregister(bfd);
/* re-enable the generation of ACCEPT for new connections */
- state->listen_bfd.when |= BSC_FD_READ;
+ state->listen_bfd.when |= OSMO_FD_READ;
/* release all exisitng calls */
gsm0408_clear_all_trans(state->net, GSM48_PDISC_CC);
@@ -151,7 +151,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
msg = llist_entry(net->upqueue.next, struct msgb, list);
mncc_prim = (struct gsm_mncc *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -166,7 +166,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -190,12 +190,12 @@ static int mncc_sock_cb(struct osmo_fd *bfd, unsigned int flags)
{
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = mncc_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = mncc_sock_write(bfd);
return rc;
@@ -227,7 +227,7 @@ static void queue_hello(struct mncc_sock_state *mncc)
hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type);
msgb_enqueue(&mncc->net->upqueue, msg);
- mncc->conn_bfd.when |= BSC_FD_WRITE;
+ mncc->conn_bfd.when |= OSMO_FD_WRITE;
}
/* accept a new connection */
@@ -250,13 +250,13 @@ static int mncc_sock_accept(struct osmo_fd *bfd, unsigned int flags)
LOGP(DMNCC, LOGL_NOTICE, "MNCC app connects but we already have "
"another active connection ?!?\n");
/* We already have one MNCC app connected, this is all we support */
- state->listen_bfd.when &= ~BSC_FD_READ;
+ state->listen_bfd.when &= ~OSMO_FD_READ;
close(rc);
return 0;
}
conn_bfd->fd = rc;
- conn_bfd->when = BSC_FD_READ;
+ conn_bfd->when = OSMO_FD_READ;
conn_bfd->cb = mncc_sock_cb;
conn_bfd->data = state;
@@ -299,7 +299,7 @@ int mncc_sock_init(struct gsm_network *net, const char *sock_path)
return -1;
}
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->cb = mncc_sock_accept;
bfd->data = state;
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c
index 1cee3fe81..3b76d5793 100644
--- a/openbsc/src/libmsc/smpp_smsc.c
+++ b/openbsc/src/libmsc/smpp_smsc.c
@@ -915,7 +915,7 @@ static int link_accept_cb(struct smsc *smsc, int fd,
osmo_wqueue_init(&esme->wqueue, 10);
esme->wqueue.bfd.fd = fd;
esme->wqueue.bfd.data = esme;
- esme->wqueue.bfd.when = BSC_FD_READ;
+ esme->wqueue.bfd.when = OSMO_FD_READ;
if (osmo_fd_register(&esme->wqueue.bfd) != 0) {
close(fd);
diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c
index 6b38ee5fe..59fee12b8 100644
--- a/openbsc/src/libtrau/rtp_proxy.c
+++ b/openbsc/src/libtrau/rtp_proxy.c
@@ -286,7 +286,7 @@ int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame)
else
memcpy(payload, frame->data, payload_len);
msgb_enqueue(&rss->tx_queue, msg);
- rss->bfd.when |= BSC_FD_WRITE;
+ rss->bfd.when |= OSMO_FD_WRITE;
return 0;
}
@@ -396,7 +396,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss)
rc = read(rss->bfd.fd, msg->data, RTP_ALLOC_SIZE);
if (rc == 0) {
- rss->bfd.when &= ~BSC_FD_READ;
+ rss->bfd.when &= ~OSMO_FD_READ;
goto out_free;
} else if (rc < 0) {
/* Ignore "connection refused". this happens, If we open the
@@ -405,7 +405,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss)
goto out_free;
DEBUGPC(DLMUX, "Read of RTP socket (%p) failed (errno %d, "
"%s)\n", rs, errno, strerror(errno));
- rss->bfd.when &= ~BSC_FD_READ;
+ rss->bfd.when &= ~OSMO_FD_READ;
goto out_free;
}
@@ -430,7 +430,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss)
goto out_free;
}
msgb_enqueue(&other_rss->tx_queue, msg);
- other_rss->bfd.when |= BSC_FD_WRITE;
+ other_rss->bfd.when |= OSMO_FD_WRITE;
break;
case RTP_RECV_UPSTREAM:
@@ -448,7 +448,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss)
if (rc < 0)
goto out_free;
msgb_enqueue(&rss->tx_queue, msg);
- rss->bfd.when |= BSC_FD_WRITE;
+ rss->bfd.when |= OSMO_FD_WRITE;
break;
}
if (rss->bfd.priv_nr != RTP_PRIV_RTP) {
@@ -482,7 +482,7 @@ static int rtp_socket_write(struct rtp_socket *rs, struct rtp_sub_socket *rss)
msg = msgb_dequeue(&rss->tx_queue);
if (!msg) {
- rss->bfd.when &= ~BSC_FD_WRITE;
+ rss->bfd.when &= ~OSMO_FD_WRITE;
return 0;
}
@@ -516,10 +516,10 @@ static int rtp_bfd_cb(struct osmo_fd *bfd, unsigned int flags)
return -EINVAL;
}
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rtp_socket_read(rs, rss);
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rtp_socket_write(rs, rss);
return 0;
@@ -600,7 +600,7 @@ static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, uint32_t ip,
rss->sin_local.sin_family = AF_INET;
rss->sin_local.sin_addr.s_addr = htonl(ip);
rss->sin_local.sin_port = htons(port);
- rss->bfd.when |= BSC_FD_READ;
+ rss->bfd.when |= OSMO_FD_READ;
rc = bind(rss->bfd.fd, (struct sockaddr *)&rss->sin_local,
sizeof(rss->sin_local));
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
index badecc682..a4b0d0f01 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
@@ -153,7 +153,7 @@ static int mgcp_create_port(struct bsc_msc_data *data)
}
osmo_wqueue_init(&data->mgcp_agent, 10);
- data->mgcp_agent.bfd.when = BSC_FD_READ;
+ data->mgcp_agent.bfd.when = OSMO_FD_READ;
data->mgcp_agent.bfd.data = data;
data->mgcp_agent.read_cb = mgcp_do_read;
data->mgcp_agent.write_cb = mgcp_do_write;
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 220efa3e8..8a71f53f5 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -246,7 +246,7 @@ int main(int argc, char **argv)
/* we need to bind a socket */
if (rc == 0) {
- cfg->gw_fd.bfd.when = BSC_FD_READ;
+ cfg->gw_fd.bfd.when = OSMO_FD_READ;
cfg->gw_fd.bfd.cb = read_call_agent;
cfg->gw_fd.bfd.fd = socket(AF_INET, SOCK_DGRAM, 0);
if (cfg->gw_fd.bfd.fd < 0) {
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 1b0abf371..069c9646b 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -1127,7 +1127,7 @@ static int init_mgcp_socket(struct bsc_nat *nat, struct mgcp_config *cfg)
}
osmo_wqueue_init(&cfg->gw_fd, 10);
- cfg->gw_fd.bfd.when = BSC_FD_READ;
+ cfg->gw_fd.bfd.when = OSMO_FD_READ;
cfg->gw_fd.bfd.data = nat;
cfg->gw_fd.read_cb = mgcp_do_read;
cfg->gw_fd.write_cb = mgcp_do_write;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 9bb33adcf..3376d39bc 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1381,7 +1381,7 @@ static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what)
struct sockaddr_in sa;
socklen_t sa_len = sizeof(sa);
- if (!(what & BSC_FD_READ))
+ if (!(what & OSMO_FD_READ))
return 0;
fd = accept(bfd->fd, (struct sockaddr *) &sa, &sa_len);
@@ -1431,7 +1431,7 @@ static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what)
bsc->write_queue.bfd.fd = fd;
bsc->write_queue.read_cb = ipaccess_bsc_read_cb;
bsc->write_queue.write_cb = bsc_write_cb;
- bsc->write_queue.bfd.when = BSC_FD_READ;
+ bsc->write_queue.bfd.when = OSMO_FD_READ;
if (osmo_fd_register(&bsc->write_queue.bfd) < 0) {
LOGP(DNAT, LOGL_ERROR, "Failed to register BSC fd.\n");
close(fd);
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index d44b1b2fe..471743ac9 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -237,7 +237,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what)
socklen_t sa_len = sizeof(sa);
int fd;
- if (!(what & BSC_FD_READ))
+ if (!(what & OSMO_FD_READ))
return 0;
fd = accept(bfd->fd, (struct sockaddr *) &sa, &sa_len);
@@ -259,7 +259,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what)
osmo_wqueue_init(&conn->queue, 10);
conn->queue.bfd.data = conn;
conn->queue.bfd.fd = fd;
- conn->queue.bfd.when = BSC_FD_READ;
+ conn->queue.bfd.when = OSMO_FD_READ;
conn->queue.read_cb = ussd_read_cb;
conn->queue.write_cb = bsc_write_cb;