remove unused remote UDP variable

Change-Id: I3256ead1d6c4b8d64468fe1635b10a47e37e4df8
This commit is contained in:
Kevin Redon 2018-10-11 17:24:39 +02:00 committed by Harald Welte
parent 39eb9dce71
commit 193a8c19c3
1 changed files with 10 additions and 31 deletions

View File

@ -45,9 +45,6 @@ struct st_transport {
uint8_t out;
uint8_t irq_in;
} usb_ep;
/* UDP */
int udp_fd;
};
/* a SIMtrace slot; communicates over a transport */
@ -126,15 +123,11 @@ int st_transp_tx_msg(struct st_transport *transp, struct msgb *msg)
printf("<- %s\n", msgb_hexdump(msg));
if (transp->udp_fd < 0) {
int xfer_len;
int xfer_len;
rc = libusb_bulk_transfer(transp->usb_devh, transp->usb_ep.out,
msgb_data(msg), msgb_length(msg),
&xfer_len, 100000);
} else {
rc = write(transp->udp_fd, msgb_data(msg), msgb_length(msg));
}
rc = libusb_bulk_transfer(transp->usb_devh, transp->usb_ep.out,
msgb_data(msg), msgb_length(msg),
&xfer_len, 100000);
msgb_free(msg);
return rc;
@ -721,22 +714,10 @@ int main(int argc, char **argv)
goto do_exit;
}
transp->udp_fd = -1;
if (!remote_udp_host) {
rc = libusb_init(NULL);
if (rc < 0) {
fprintf(stderr, "libusb initialization failed\n");
goto do_exit;
}
} else {
transp->udp_fd = osmo_sock_init(AF_INET, SOCK_DGRAM, IPPROTO_UDP,
remote_udp_host, remote_udp_port+if_num,
OSMO_SOCK_F_CONNECT);
if (transp->udp_fd < 0) {
fprintf(stderr, "error binding UDP port\n");
goto do_exit;
}
rc = libusb_init(NULL);
if (rc < 0) {
fprintf(stderr, "libusb initialization failed\n");
goto do_exit;
}
g_gti = gsmtap_source_init(gsmtap_host, GSMTAP_UDP_PORT, 0);
@ -818,8 +799,7 @@ int main(int argc, char **argv)
run_mainloop(ci);
ret = 0;
if (transp->udp_fd < 0)
libusb_release_interface(transp->usb_devh, 0);
libusb_release_interface(transp->usb_devh, 0);
close_exit:
if (transp->usb_devh)
libusb_close(transp->usb_devh);
@ -827,8 +807,7 @@ close_exit:
sleep(1);
} while (keep_running);
if (transp->udp_fd < 0)
libusb_exit(NULL);
libusb_exit(NULL);
do_exit:
return ret;
}