fire-scope 0.1.7

This tool is a CLI application and library that collects and aggregates corresponding IP addresses by specifying country codes and AS numbers, and outputs them to a file in TXT or nftables format.It supports RIR file download and whois AS number query, and also has a function to extract overlapping parts of country codes and AS numbers in CIDR units.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::asn::process_as_numbers;
use crate::common::OutputFormat;
use crate::error::AppError;
use reqwest::Client;

/// ユーザー指定ASリストを受け取りRDAPで処理
pub async fn run_as_numbers(
    client: &Client,
    as_numbers: &[u32],
    output_format: OutputFormat,
    concurrency: usize,
) -> Result<(), AppError> {
    // RDAPは純粋な数値のみを期待
    let as_strings: Vec<String> = as_numbers.iter().map(|n| n.to_string()).collect();
    process_as_numbers(client, &as_strings, output_format, concurrency).await
}