diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-09 19:17:12 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-07-15 18:38:11 +0200 |
commit | 8e9f40a912a1c1157c84ff99449e5626963a0c3d (patch) | |
tree | 6777fb2d1c9cdbf92ae819fc93399f815d4795a9 /src/ipaccess | |
parent | 56c7ecda0e391d77fc2ffe90adafbf864365c60c (diff) |
Use OSMO_FD_* instead of deprecated BSC_FD_*
New define is available since libosmocore 1.1.0, and we already require
1.3.0, so no need to update dependenices.
Let's change it to avoid people re-using old BSC_FD_* symbols when
copy-pasting somewhere else.
Change-Id: Ia5a656567d212fa265aef1375d714d0c5fee5dd6
Diffstat (limited to 'src/ipaccess')
-rw-r--r-- | src/ipaccess/abisip-find.c | 10 | ||||
-rw-r--r-- | src/ipaccess/ipaccess-config.c | 2 | ||||
-rw-r--r-- | src/ipaccess/ipaccess-proxy.c | 22 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 21ed50e5a..11b2851ae 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -403,10 +403,10 @@ static int read_response(int fd) static int bfd_cb(struct osmo_fd *bfd, unsigned int flags) { - if (flags & BSC_FD_READ) + if (flags & OSMO_FD_READ) return read_response(bfd->fd); - if (flags & BSC_FD_WRITE) { - bfd->when &= ~BSC_FD_WRITE; + if (flags & OSMO_FD_WRITE) { + bfd->when &= ~OSMO_FD_WRITE; return bcast_find(bfd->fd); } return 0; @@ -418,7 +418,7 @@ static void timer_cb(void *_data) { struct osmo_fd *bfd = _data; - bfd->when |= BSC_FD_WRITE; + bfd->when |= OSMO_FD_WRITE; base_stations_bump(false); @@ -447,7 +447,7 @@ int main(int argc, char **argv) fprintf(stdout, "\nWARNING: the --timeout should be larger than --interval.\n\n"); bfd.cb = bfd_cb; - bfd.when = BSC_FD_READ | BSC_FD_WRITE; + bfd.when = OSMO_FD_READ | OSMO_FD_WRITE; bfd.fd = udp_sock(cmdline_opts.ifname, cmdline_opts.bind_ip); if (bfd.fd < 0) { perror("Cannot create local socket for broadcast udp"); diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 306cc8786..f7d733231 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -92,7 +92,7 @@ static int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa) bfd->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); bfd->cb = ipaccess_fd_cb; - bfd->when = BSC_FD_READ | BSC_FD_WRITE; + bfd->when = OSMO_FD_READ | OSMO_FD_WRITE; bfd->data = line; bfd->priv_nr = E1INP_SIGN_OML; diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c index f4d620b34..05a6f6358 100644 --- a/src/ipaccess/ipaccess-proxy.c +++ b/src/ipaccess/ipaccess-proxy.c @@ -283,7 +283,7 @@ static int handle_udp_read(struct osmo_fd *bfd) if (other_conn) { /* enqueue the message for TX on the respective FD */ msgb_enqueue(&other_conn->tx_queue, msg); - other_conn->fd.when |= BSC_FD_WRITE; + other_conn->fd.when |= OSMO_FD_WRITE; } else msgb_free(msg); @@ -293,7 +293,7 @@ static int handle_udp_read(struct osmo_fd *bfd) static int handle_udp_write(struct osmo_fd *bfd) { /* not implemented yet */ - bfd->when &= ~BSC_FD_WRITE; + bfd->when &= ~OSMO_FD_WRITE; return -EIO; } @@ -303,9 +303,9 @@ static int udp_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0; - if (what & BSC_FD_READ) + if (what & OSMO_FD_READ) rc = handle_udp_read(bfd); - if (what & BSC_FD_WRITE) + if (what & OSMO_FD_WRITE) rc = handle_udp_write(bfd); return rc; @@ -840,7 +840,7 @@ static int handle_tcp_read(struct osmo_fd *bfd) /* enqueue packet towards BSC */ msgb_enqueue(&bsc_conn->tx_queue, msg); /* mark respective filedescriptor as 'we want to write' */ - bsc_conn->fd.when |= BSC_FD_WRITE; + bsc_conn->fd.when |= OSMO_FD_WRITE; } else { logp_ipbc_uid(DLINP, LOGL_INFO, ipbc, bfd->priv_nr >> 8); LOGPC(DLINP, LOGL_INFO, "Dropping packet from %s, " @@ -869,7 +869,7 @@ static int handle_tcp_write(struct osmo_fd *bfd) /* get the next msg for this timeslot */ if (llist_empty(&ipc->tx_queue)) { - bfd->when &= ~BSC_FD_WRITE; + bfd->when &= ~OSMO_FD_WRITE; return 0; } lh = ipc->tx_queue.next; @@ -897,12 +897,12 @@ static int proxy_ipaccess_fd_cb(struct osmo_fd *bfd, unsigned int what) { int rc = 0; - if (what & BSC_FD_READ) { + if (what & OSMO_FD_READ) { rc = handle_tcp_read(bfd); if (rc < 0) return rc; } - if (what & BSC_FD_WRITE) + if (what & OSMO_FD_WRITE) rc = handle_tcp_write(bfd); return rc; @@ -917,7 +917,7 @@ static int listen_fd_cb(struct osmo_fd *listen_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; ret = accept(listen_bfd->fd, (struct sockaddr *) &sa, &sa_len); @@ -940,7 +940,7 @@ static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what) bfd->data = ipc; bfd->priv_nr = listen_bfd->priv_nr; bfd->cb = proxy_ipaccess_fd_cb; - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; ret = osmo_fd_register(bfd); if (ret < 0) { LOGP(DLINP, LOGL_ERROR, "could not register FD\n"); @@ -1019,7 +1019,7 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v bfd = &ipc->fd; bfd->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); bfd->cb = ipaccess_fd_cb; - bfd->when = BSC_FD_READ | BSC_FD_WRITE; + bfd->when = OSMO_FD_READ | OSMO_FD_WRITE; bfd->data = ipc; bfd->priv_nr = priv_nr; |