Commit 446331c0 authored by Daniel Willmann's avatar Daniel Willmann
Browse files

Remove async crates, update dependencies

We don't really use any async it in the code, so remove it.
parent a9ff4778
This diff is collapsed.
[package]
name = "gsmtap-telemetry"
version = "0.1.0"
authors = ["Daniel Willmann <dwillmann@sysmocom.de>"]
authors = ["Daniel Willmann <daniel@totalueberwachung.de>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.3.9"
ctrlc = "3.1.7"
eyre = "0.6.5"
nom = "6.0.1"
nom = "6.1.0"
nom_locate = "3.0.0"
tracing = "0.1.22"
tracing-opentelemetry = "0.10.0"
tracing = "0.1.23"
tracing-opentelemetry = "0.11.0"
tracing-subscriber = "0.2.15"
async-std = { version = "1.8.0", features = ["attributes"] }
opentelemetry = { version = "0.11.2", features = ["async-std"] }
opentelemetry-jaeger = { version = "0.10.0", features = ["async-std"] }
opentelemetry-semantic-conventions = "0.3.0"
opentelemetry = "0.12.0"
opentelemetry-jaeger = "0.11.0"
opentelemetry-semantic-conventions = "0.4.0"
pcap-parser = { version = "0.10.1", features = ["data"] }
clap = "3.0.0-beta.2"
etherparse = "0.9.0"
......
......@@ -18,13 +18,12 @@ use std::{
use tracing::{debug, error, info, trace, warn, Level};
use tracing_subscriber::EnvFilter;
use async_std::net::UdpSocket;
use std::net::UdpSocket;
use gsmtap::{parser::parse_gsmtap, Packet};
use telemetry::Telemetry;
#[async_std::main]
async fn main() -> Result<()> {
fn main() -> Result<()> {
opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
let opts = options::Opts::parse();
......@@ -47,7 +46,7 @@ async fn main() -> Result<()> {
debug!("Got options: {:?}", opts);
match &opts.file {
None => listen_socket(&opts.listen).await?,
None => listen_socket(&opts.listen)?,
Some(file) => pcap::read_pcap(file)?,
}
......@@ -55,7 +54,7 @@ async fn main() -> Result<()> {
Ok(())
}
async fn listen_socket(listen: &str) -> Result<()> {
fn listen_socket(listen: &str) -> Result<()> {
let stop = Arc::new(AtomicBool::new(false));
// ctrlc::set_handler({
// let s = stop.clone();
......@@ -64,14 +63,14 @@ async fn listen_socket(listen: &str) -> Result<()> {
// }
// })?;
// Open GSMTAP socket
let socket = UdpSocket::bind(listen).await?;
let socket = UdpSocket::bind(listen)?;
info!("Listening on {:?}", socket.local_addr());
let mut telem = Telemetry::new();
while !stop.load(Ordering::SeqCst) {
let mut buf = [0; 16 + 84 + 4096];
let (amt, src) = socket.recv_from(&mut buf).await?;
let (amt, src) = socket.recv_from(&mut buf)?;
let buf = &mut buf[..amt];
let olog = match parse_gsmtap(buf) {
......
......@@ -7,7 +7,7 @@ use std::sync::{Arc, Mutex};
#[allow(unused_imports)]
use tracing::{debug, error, info, trace, warn, Level};
use async_std::net::SocketAddr;
use std::net::SocketAddr;
use opentelemetry::trace::{Span as _, Tracer as _, TracerProvider as _};
use opentelemetry::{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment