diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gsmtap_util.c | 12 | ||||
-rw-r--r-- | src/select.c | 22 | ||||
-rw-r--r-- | src/vty/telnet_interface.c | 18 | ||||
-rw-r--r-- | src/write_queue.c | 2 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index b47f6e35..e0bc848c 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -42,8 +42,8 @@ #include <string.h> #include <errno.h> -static struct bsc_fd gsmtap_bfd = { .fd = -1 }; -static struct bsc_fd gsmtap_sink_bfd = { .fd = -1 }; +static struct osmo_fd gsmtap_bfd = { .fd = -1 }; +static struct osmo_fd gsmtap_sink_bfd = { .fd = -1 }; static LLIST_HEAD(gsmtap_txqueue); uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t link_id) @@ -137,7 +137,7 @@ int gsmtap_sendmsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, } /* Callback from select layer if we can write to the socket */ -static int gsmtap_fd_cb(struct bsc_fd *fd, unsigned int flags) +static int gsmtap_fd_cb(struct osmo_fd *fd, unsigned int flags) { struct msgb *msg; int rc; @@ -195,11 +195,11 @@ int gsmtap_init(uint32_t dst_ip) gsmtap_bfd.cb = gsmtap_fd_cb; gsmtap_bfd.data = NULL; - return bsc_register_fd(&gsmtap_bfd); + return osmo_fd_register(&gsmtap_bfd); } /* Callback from select layer if we can read from the sink socket */ -static int gsmtap_sink_fd_cb(struct bsc_fd *fd, unsigned int flags) +static int gsmtap_sink_fd_cb(struct osmo_fd *fd, unsigned int flags) { int rc; uint8_t buf[4096]; @@ -246,7 +246,7 @@ int gsmtap_sink_init(uint32_t bind_ip) gsmtap_sink_bfd.cb = gsmtap_sink_fd_cb; gsmtap_sink_bfd.data = NULL; - return bsc_register_fd(&gsmtap_sink_bfd); + return osmo_fd_register(&gsmtap_sink_bfd); } diff --git a/src/select.c b/src/select.c index 6c44f355..4ea95362 100644 --- a/src/select.c +++ b/src/select.c @@ -31,10 +31,10 @@ #ifdef HAVE_SYS_SELECT_H static int maxfd = 0; -static LLIST_HEAD(bsc_fds); +static LLIST_HEAD(osmo_fds); static int unregistered_count; -int bsc_register_fd(struct bsc_fd *fd) +int osmo_fd_register(struct osmo_fd *fd) { int flags; @@ -52,29 +52,29 @@ int bsc_register_fd(struct bsc_fd *fd) maxfd = fd->fd; #ifdef BSC_FD_CHECK - struct bsc_fd *entry; - llist_for_each_entry(entry, &bsc_fds, list) { + struct osmo_fd *entry; + llist_for_each_entry(entry, &osmo_fds, list) { if (entry == fd) { - fprintf(stderr, "Adding a bsc_fd that is already in the list.\n"); + fprintf(stderr, "Adding a osmo_fd that is already in the list.\n"); return 0; } } #endif - llist_add_tail(&fd->list, &bsc_fds); + llist_add_tail(&fd->list, &osmo_fds); return 0; } -void bsc_unregister_fd(struct bsc_fd *fd) +void osmo_fd_unregister(struct osmo_fd *fd) { unregistered_count++; llist_del(&fd->list); } -int bsc_select_main(int polling) +int osmo_select_main(int polling) { - struct bsc_fd *ufd, *tmp; + struct osmo_fd *ufd, *tmp; fd_set readset, writeset, exceptset; int work = 0, rc; struct timeval no_time = {0, 0}; @@ -84,7 +84,7 @@ int bsc_select_main(int polling) FD_ZERO(&exceptset); /* prepare read and write fdsets */ - llist_for_each_entry(ufd, &bsc_fds, list) { + llist_for_each_entry(ufd, &osmo_fds, list) { if (ufd->when & BSC_FD_READ) FD_SET(ufd->fd, &readset); @@ -109,7 +109,7 @@ int bsc_select_main(int polling) /* call registered callback functions */ restart: unregistered_count = 0; - llist_for_each_entry_safe(ufd, tmp, &bsc_fds, list) { + llist_for_each_entry_safe(ufd, tmp, &osmo_fds, list) { int flags = 0; if (FD_ISSET(ufd->fd, &readset)) { diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index 0d45d614..78459944 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -39,9 +39,9 @@ LLIST_HEAD(active_connections); static void *tall_telnet_ctx; /* per network data */ -static int telnet_new_connection(struct bsc_fd *fd, unsigned int what); +static int telnet_new_connection(struct osmo_fd *fd, unsigned int what); -static struct bsc_fd server_socket = { +static struct osmo_fd server_socket = { .when = BSC_FD_READ, .cb = telnet_new_connection, .priv_nr = 0, @@ -85,7 +85,7 @@ int telnet_init(void *tall_ctx, void *priv, int port) server_socket.data = priv; server_socket.fd = fd; - bsc_register_fd(&server_socket); + osmo_fd_register(&server_socket); return 0; } @@ -104,12 +104,12 @@ static void print_welcome(int fd) ret = write(fd, host.app_info->copyright, strlen(host.app_info->copyright)); } -int telnet_close_client(struct bsc_fd *fd) +int telnet_close_client(struct osmo_fd *fd) { struct telnet_connection *conn = (struct telnet_connection*)fd->data; close(fd->fd); - bsc_unregister_fd(fd); + osmo_fd_unregister(fd); if (conn->dbg) { log_del_target(conn->dbg); @@ -121,7 +121,7 @@ int telnet_close_client(struct bsc_fd *fd) return 0; } -static int client_data(struct bsc_fd *fd, unsigned int what) +static int client_data(struct osmo_fd *fd, unsigned int what) { struct telnet_connection *conn = fd->data; int rc = 0; @@ -144,7 +144,7 @@ static int client_data(struct bsc_fd *fd, unsigned int what) return rc; } -static int telnet_new_connection(struct bsc_fd *fd, unsigned int what) +static int telnet_new_connection(struct osmo_fd *fd, unsigned int what) { struct telnet_connection *connection; struct sockaddr_in sockaddr; @@ -162,7 +162,7 @@ static int telnet_new_connection(struct bsc_fd *fd, unsigned int what) connection->fd.fd = new_connection; connection->fd.when = BSC_FD_READ; connection->fd.cb = client_data; - bsc_register_fd(&connection->fd); + osmo_fd_register(&connection->fd); llist_add_tail(&connection->entry, &active_connections); print_welcome(new_connection); @@ -182,7 +182,7 @@ static int telnet_new_connection(struct bsc_fd *fd, unsigned int what) void vty_event(enum event event, int sock, struct vty *vty) { struct telnet_connection *connection = vty->priv; - struct bsc_fd *bfd = &connection->fd; + struct osmo_fd *bfd = &connection->fd; if (vty->type != VTY_TERM) return; diff --git a/src/write_queue.c b/src/write_queue.c index 0642aad6..c357c3fa 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -23,7 +23,7 @@ #include <osmocom/core/write_queue.h> -int write_queue_bfd_cb(struct bsc_fd *fd, unsigned int what) +int write_queue_bfd_cb(struct osmo_fd *fd, unsigned int what) { struct write_queue *queue; |