[package]
name = "bgpkit-parser"
version = "0.10.0"
authors = ["Mingwei Zhang <mingwei@bgpkit.com>"]
edition = "2021"
license = "MIT"
repository = "https://github.com/bgpkit/bgpkit-parser"
documentation = "https://docs.rs/bgpkit-parser"
description = "MRT/BGP/BMP data processing library"
keywords = ["bgp", "bgpkit", "mrt"]
categories = ["network-programming"]
default-run = "bgpkit-parser"
readme = "README.md"

[[bin]]
name = "bgpkit-parser"
path = "src/bin/main.rs"
required-features = ["cli"]

[dependencies]

####################
# Core BGP structs #
####################
num_enum = { version = "0.7", optional = true }
serde={version="1.0", features=["derive"], optional = true}
itertools = {version = "0.12", optional = true}
ipnet = {version="2.7", optional = true}
bitflags = {version="2.3.3", features = ["serde"], optional = true}

#######################
# Parser dependencies #
#######################
bytes = {version = "1.5.0", optional = true}
hex= {version = "0.4.3", optional = true} # bmp/openbmp parsing
log= {version = "0.4", optional = true }
oneio = {version= "0.16.0", default-features = false, features = ["lib-core"], optional = true }
regex = {version = "1", optional = true} # used in parser filter
chrono = {version="0.4.24", optional = true} # parser filter
serde_json = {version = "1.0", optional = true } # RIS Live parsing

####################
# CLI dependencies #
####################
env_logger = {version="0.10", optional=true}
clap = {version= "4.0", features=["derive"], optional=true}

[features]
default = ["parser", "rustls"]
models = [
    "num_enum",
    "num_enum/complex-expressions",
    "ipnet",
    "itertools",
    "bitflags",
]
parser = [
    "bytes",
    "chrono",
    "env_logger",
    "log",
    "models",
    "regex",
]
cli = [
    "clap",
    "parser",
    "env_logger",
    "serde",
    "serde_json"
]
rislive = [
    "parser",
    "serde",
    "serde_json",
    "hex",
]
serde = [
    "dep:serde",
    "ipnet/serde",
]
native-tls = [
    "oneio/native-tls",
]
rustls = [
    "oneio/rustls",
]

[[bench]]
name = "internals"
harness = false

[[bench]]
name = "bench_main"
harness = false

[dev-dependencies]
anyhow = "1"
bgpkit-broker = "0.7.0-beta.5"
kafka = "0.10.0"
tungstenite= "0.21.0"
url = "2.1.0"
criterion = {version= "0.5.1", features=["html_reports"]}
rayon = "1.5.1"
bzip2 = "0.4"
flate2 = "1.0.25"
md5 = "0.7.0"
which = "5"
serde_json = "1.0"
hex = "0.4.3"
tempdir = "0.3"
ctrlc = "3.4"
tracing = "0.1"
tracing-subscriber = "0.3"

# This list only includes examples which require additional features to run. These are more in the examples directory.
[[example]]
name = "real-time-ris-live-websocket"
required-features = ["rislive"]

[[example]]
name = "peer_index_table"
required-features = ["serde"]

[[example]]
name = "deprecated_attributes"
required-features = ["serde"]

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz"
pkg-fmt = "tgz"