From 4db92992865e1548e32ba2e95a9dc074dd90847b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 6 May 2011 12:11:23 +0200 Subject: src: use namespace prefix osmo_fd* and osmo_select* Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g --- openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 6 +++--- openbsc/src/osmo-bsc_nat/bsc_nat.c | 16 ++++++++-------- openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_ussd.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'openbsc/src/osmo-bsc_nat') diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 95a5388ff..be2666de3 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -598,7 +598,7 @@ struct msgb *bsc_mgcp_rewrite(char *input, int length, int endpoint, const char return output; } -static int mgcp_do_read(struct bsc_fd *fd) +static int mgcp_do_read(struct osmo_fd *fd) { struct bsc_nat *nat; struct msgb *msg, *resp; @@ -637,7 +637,7 @@ static int mgcp_do_read(struct bsc_fd *fd) return 0; } -static int mgcp_do_write(struct bsc_fd *bfd, struct msgb *msg) +static int mgcp_do_write(struct osmo_fd *bfd, struct msgb *msg) { int rc; @@ -704,7 +704,7 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat) cfg->gw_fd.read_cb = mgcp_do_read; cfg->gw_fd.write_cb = mgcp_do_write; - if (bsc_register_fd(&cfg->gw_fd.bfd) != 0) { + if (osmo_fd_register(&cfg->gw_fd.bfd) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register MGCP fd.\n"); close(cfg->gw_fd.bfd.fd); cfg->gw_fd.bfd.fd = -1; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index ffcd3884c..0fb58436b 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -64,7 +64,7 @@ struct log_target *stderr_target; static const char *config_file = "bsc-nat.cfg"; static struct in_addr local_addr; -static struct bsc_fd bsc_listen; +static struct osmo_fd bsc_listen; static const char *msc_ip = NULL; static struct osmo_timer_list sccp_close; static int daemonize = 0; @@ -780,7 +780,7 @@ static void msc_send_reset(struct bsc_msc_connection *msc_con) LOGP(DMSC, LOGL_NOTICE, "Scheduled GSM0808 reset msg for the MSC.\n"); } -static int ipaccess_msc_read_cb(struct bsc_fd *bfd) +static int ipaccess_msc_read_cb(struct osmo_fd *bfd) { int error; struct bsc_msc_connection *msc_con; @@ -818,7 +818,7 @@ static int ipaccess_msc_read_cb(struct bsc_fd *bfd) return 0; } -static int ipaccess_msc_write_cb(struct bsc_fd *bfd, struct msgb *msg) +static int ipaccess_msc_write_cb(struct osmo_fd *bfd, struct msgb *msg) { int rc; rc = write(bfd->fd, msg->data, msg->len); @@ -875,7 +875,7 @@ void bsc_close_connection(struct bsc_connection *connection) /* close endpoints allocated by this BSC */ bsc_mgcp_clear_endpoints_for(connection); - bsc_unregister_fd(&connection->write_queue.bfd); + osmo_fd_unregister(&connection->write_queue.bfd); close(connection->write_queue.bfd.fd); write_queue_clear(&connection->write_queue); llist_del(&connection->list_entry); @@ -1147,7 +1147,7 @@ exit3: return -1; } -static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) +static int ipaccess_bsc_read_cb(struct osmo_fd *bfd) { int error; struct bsc_connection *bsc = bfd->data; @@ -1194,7 +1194,7 @@ static int ipaccess_bsc_read_cb(struct bsc_fd *bfd) return 0; } -static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) +static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what) { struct bsc_connection *bsc; int fd, rc, on; @@ -1256,7 +1256,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) 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; - if (bsc_register_fd(&bsc->write_queue.bfd) < 0) { + if (osmo_fd_register(&bsc->write_queue.bfd) < 0) { LOGP(DNAT, LOGL_ERROR, "Failed to register BSC fd.\n"); close(fd); talloc_free(bsc); @@ -1514,7 +1514,7 @@ int main(int argc, char **argv) osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0); while (1) { - bsc_select_main(0); + osmo_select_main(0); } return 0; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 9ddc948cd..e796b2b89 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -787,7 +787,7 @@ int bsc_conn_type_to_ctr(struct sccp_connections *conn) return con_to_ctr[conn->con_type]; } -int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg) +int bsc_write_cb(struct osmo_fd *bfd, struct msgb *msg) { int rc; diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 5d599c734..910ef4073 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -58,7 +58,7 @@ static void bsc_nat_ussd_destroy(struct bsc_nat_ussd_con *con) } close(con->queue.bfd.fd); - bsc_unregister_fd(&con->queue.bfd); + osmo_fd_unregister(&con->queue.bfd); osmo_timer_del(&con->auth_timeout); write_queue_clear(&con->queue); talloc_free(con); @@ -95,7 +95,7 @@ static int forward_sccp(struct bsc_nat *nat, struct msgb *msg) return 0; } -static int ussd_read_cb(struct bsc_fd *bfd) +static int ussd_read_cb(struct osmo_fd *bfd) { int error; struct bsc_nat_ussd_con *conn = bfd->data; @@ -191,7 +191,7 @@ static void ussd_start_auth(struct bsc_nat_ussd_con *conn) bsc_do_write(&conn->queue, msg, IPAC_PROTO_IPACCESS); } -static int ussd_listen_cb(struct bsc_fd *bfd, unsigned int what) +static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) { struct bsc_nat_ussd_con *conn; struct bsc_nat *nat; @@ -225,7 +225,7 @@ static int ussd_listen_cb(struct bsc_fd *bfd, unsigned int what) conn->queue.read_cb = ussd_read_cb; conn->queue.write_cb = bsc_write_cb; - if (bsc_register_fd(&conn->queue.bfd) < 0) { + if (osmo_fd_register(&conn->queue.bfd) < 0) { LOGP(DNAT, LOGL_ERROR, "Failed to register USSD fd.\n"); bsc_nat_ussd_destroy(conn); return -1; -- cgit v1.2.3