rscamper 0.2.2

Rust interface to scamper network measurement tool
Documentation
// rscamper - Rust FFI bindings for scamper_icmpext.h
//
// Copyright (C) 2026 Dimitrios Giakatos
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 3.

use libc::c_int;

#[repr(C)]
pub struct ScamperIcmpextT {
    _opaque: [u8; 0],
}

#[repr(C)]
pub struct ScamperIcmpextsT {
    _opaque: [u8; 0],
}

unsafe extern "C" {
    pub fn scamper_icmpexts_use(exts: *mut ScamperIcmpextsT) -> *mut ScamperIcmpextsT;
    pub fn scamper_icmpexts_free(exts: *mut ScamperIcmpextsT);
    pub fn scamper_icmpexts_cmp(
        a: *const ScamperIcmpextsT,
        b: *const ScamperIcmpextsT,
    ) -> c_int;
    pub fn scamper_icmpexts_count_get(exts: *const ScamperIcmpextsT) -> u16;
    pub fn scamper_icmpexts_ext_get(
        exts: *const ScamperIcmpextsT,
        i: u16,
    ) -> *mut ScamperIcmpextT;

    pub fn scamper_icmpext_use(ie: *mut ScamperIcmpextT) -> *mut ScamperIcmpextT;
    pub fn scamper_icmpext_free(ie: *mut ScamperIcmpextT);
    pub fn scamper_icmpext_cmp(
        a: *const ScamperIcmpextT,
        b: *const ScamperIcmpextT,
    ) -> c_int;

    pub fn scamper_icmpext_is_mpls(ie: *const ScamperIcmpextT) -> c_int;
    pub fn scamper_icmpext_mpls_count_get(ie: *const ScamperIcmpextT) -> u16;
    pub fn scamper_icmpext_mpls_label_get(ie: *const ScamperIcmpextT, i: u16) -> u32;
    pub fn scamper_icmpext_mpls_ttl_get(ie: *const ScamperIcmpextT, i: u16) -> u8;
    pub fn scamper_icmpext_mpls_exp_get(ie: *const ScamperIcmpextT, i: u16) -> u8;
    pub fn scamper_icmpext_mpls_s_get(ie: *const ScamperIcmpextT, i: u16) -> u8;
}