restructure code from lib to mod
This commit is contained in:
@@ -4,9 +4,10 @@ use std::sync::{Arc, Condvar, Mutex};
|
|||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
//use std::thread::{Builder, JoinHandle};
|
//use std::thread::{Builder, JoinHandle};
|
||||||
|
|
||||||
use rsnmpagent::config;
|
mod rsnmplib;
|
||||||
use rsnmpagent::snmp::{Oid, OidData, SnmpCommands};
|
use rsnmplib::config;
|
||||||
use rsnmpagent::start_workers;
|
use rsnmplib::snmp::{Oid, OidData, SnmpCommands};
|
||||||
|
use rsnmplib::start_workers;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ pub mod helper;
|
|||||||
pub mod multipath;
|
pub mod multipath;
|
||||||
pub mod processes;
|
pub mod processes;
|
||||||
pub mod snmp;
|
pub mod snmp;
|
||||||
use crate::bonding::bonding_status;
|
use bonding::bonding_status;
|
||||||
use crate::config::DataFunctionsFilesum;
|
use config::DataFunctionsFilesum;
|
||||||
use crate::filesum::filesum_filtered;
|
use filesum::filesum_filtered;
|
||||||
use crate::helper::compile_re;
|
use helper::compile_re;
|
||||||
use crate::multipath::multipath_status;
|
use multipath::multipath_status;
|
||||||
use crate::processes::Ptypes;
|
use processes::Ptypes;
|
||||||
use crate::snmp::{Oid, OidData, SnmpData};
|
use snmp::{Oid, OidData, SnmpData};
|
||||||
|
|
||||||
fn t_multipath(
|
fn t_multipath(
|
||||||
t_quit: Arc<(Mutex<bool>, Condvar)>,
|
t_quit: Arc<(Mutex<bool>, Condvar)>,
|
||||||
@@ -49,11 +49,11 @@ impl Oid {
|
|||||||
x
|
x
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_suffix(&self, o: &Oid) -> Oid {
|
/* pub fn add_suffix(&self, o: &Oid) -> Oid {
|
||||||
let mut x = self.clone();
|
let mut x = self.clone();
|
||||||
x.0.extend(o.clone().0);
|
x.0.extend(o.clone().0);
|
||||||
x
|
x
|
||||||
}
|
} */
|
||||||
|
|
||||||
pub fn add_suffix_int(&self, o: u32) -> Oid {
|
pub fn add_suffix_int(&self, o: u32) -> Oid {
|
||||||
let mut x = self.clone();
|
let mut x = self.clone();
|
||||||
@@ -111,12 +111,13 @@ pub struct OidData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl OidData {
|
impl OidData {
|
||||||
|
/*
|
||||||
pub fn new(base_oid: &str) -> Self {
|
pub fn new(base_oid: &str) -> Self {
|
||||||
Self {
|
Self {
|
||||||
base: base_oid.parse().expect("Unable to parse Oid"),
|
base: base_oid.parse().expect("Unable to parse Oid"),
|
||||||
data: BTreeMap::new(),
|
data: BTreeMap::new(),
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
pub fn new_oid(base_oid: &Oid) -> Self {
|
pub fn new_oid(base_oid: &Oid) -> Self {
|
||||||
Self {
|
Self {
|
||||||
Reference in New Issue
Block a user