import nispor-1.0.1-4.el8

This commit is contained in:
CentOS Sources 2021-02-19 08:13:42 +00:00 committed by Andrew Lukoshko
parent 71a22f872f
commit 491997bf4c
2 changed files with 812 additions and 9 deletions

View File

@ -0,0 +1,807 @@
From 6655f63d3c8d5a551925a43b1fbf16a153a5c4cc Mon Sep 17 00:00:00 2001
From: Fernando Fernandez Mancera <ffmancera@riseup.net>
Date: Tue, 16 Feb 2021 12:06:18 +0100
Subject: [PATCH] varlink: remove the varlink support
There is no real user for varlink support on nispor. This patch is
removing the varlink support and all the documentation related to it.
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
---
Cargo.toml | 1 -
DEVEL.md | 5 -
Makefile | 35 +---
README.md | 14 --
src/varlink/Cargo.toml | 17 --
src/varlink/info.nispor.varlink | 263 -----------------------------
src/varlink/info_nispor.rs | 228 -------------------------
src/varlink/npd.rs | 51 ------
src/varlink/systemd/nispor.service | 10 --
src/varlink/systemd/nispor.socket | 10 --
10 files changed, 5 insertions(+), 629 deletions(-)
delete mode 100644 src/varlink/Cargo.toml
delete mode 100644 src/varlink/info.nispor.varlink
delete mode 100644 src/varlink/info_nispor.rs
delete mode 100644 src/varlink/npd.rs
delete mode 100644 src/varlink/systemd/nispor.service
delete mode 100644 src/varlink/systemd/nispor.socket
diff --git a/Cargo.toml b/Cargo.toml
index b03c824..59a55be 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,5 @@
[workspace]
members = [
- "src/varlink",
"src/lib",
"src/cli",
"src/clib",
diff --git a/DEVEL.md b/DEVEL.md
index bd96064..0ebcc1f 100644
--- a/DEVEL.md
+++ b/DEVEL.md
@@ -9,7 +9,6 @@
* [Design](#design)
* [Rust module](#rust-module)
* [Command line tool](#command-line-tool)
- * [Varlink service](#varlink-service)
* [Python binding](#python-binding)
* [Check list for creating PR:](#check-list-for-creating-pr)
* [Release workflow](#release-workflow)
@@ -43,10 +42,6 @@ Path: `src/lib`
Path: `src/cli`
-### Varlink service
-
-Path: `src/varlink`
-
### Python binding
Path: `src/python`
diff --git a/Makefile b/Makefile
index b628944..2e92906 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,6 @@ include ./Makefile.inc
RUST_DEBUG_BIN_DIR=./target/debug
RUST_RELEASE_BIN_DIR=./target/release
-VARLINK_SRV_EXEC=npd
-VARLINK_SRV_EXEC_DEBUG=$(RUST_DEBUG_BIN_DIR)/$(VARLINK_SRV_EXEC)
-VARLINK_SRV_EXEC_RELEASE=$(RUST_RELEASE_BIN_DIR)/$(VARLINK_SRV_EXEC)
CLI_EXEC=npc
CLI_EXEC_DEBUG=$(RUST_DEBUG_BIN_DIR)/$(CLI_EXEC)
CLIB_HEADER=nispor.h
@@ -18,8 +15,6 @@ CLI_EXEC_RELEASE=$(RUST_RELEASE_BIN_DIR)/$(CLI_EXEC)
SOCKET_FILE=/run/nispor/nispor.so
SOCKET_DIR=$(dir $(SOCKET_FILE))
SOCKET_ADDR=unix:$(SOCKET_FILE)
-SYSTEMD_SERVICE_FILE=src/varlink/systemd/nispor.service
-SYSTEMD_SOCKET_FILE=src/varlink/systemd/nispor.socket
PREFIX ?= /usr/local
CPU_BITS = $(shell getconf LONG_BIT)
@@ -34,8 +29,7 @@ PKG_CONFIG_LIBDIR ?= $(LIBDIR)/pkgconfig
SKIP_PYTHON_INSTALL ?=0
-all: $(VARLINK_SRV_EXEC_DEBUG) $(CLI_EXEC_DEBUG) \
- $(VARLINK_SRV_EXEC_RELEASE) $(CLI_EXEC_RELEASE)
+all: $(CLI_EXEC_DEBUG) $(CLI_EXEC_RELEASE)
SYSTEMD_SYS_UNIT_DIR ?= $(shell \
pkg-config --variable=systemdsystemunitdir systemd)
@@ -46,16 +40,16 @@ PYTHON3_SITE_DIR ?=$(shell \
print(get_python_lib())")
# Always invoke cargo build for debug
-.PHONY: $(VARLINK_SRV_EXEC_DEBUG) $(CLI_EXEC_DEBUG)
+.PHONY: $(CLI_EXEC_DEBUG)
debug: $(CLI_EXEC_DEBUG)
$(CLI_EXEC_DEBUG) $(ARGS)
-$(CLI_EXEC_DEBUG) $(VARLINK_SRV_EXEC_DEBUG):
+$(CLI_EXEC_DEBUG):
cargo build --all
-$(CLI_EXEC_RELEASE) $(VARLINK_SRV_EXEC_RELEASE) $(CLIB_SO_DEV_RELEASE):
+$(CLI_EXEC_RELEASE) $(CLIB_SO_DEV_RELEASE):
cargo build --all --release
check:
@@ -65,30 +59,13 @@ check:
fi
make check -C test/clib
-srv: $(VARLINK_SRV_EXEC_DEBUG)
- echo $(SOCKET_DIR)
- if [ ! -d $(SOCKET_DIR) ]; then \
- sudo mkdir $(SOCKET_DIR); \
- sudo chmod 0777 $(SOCKET_DIR); \
- fi
- $(VARLINK_SRV_EXEC_DEBUG) $(SOCKET_ADDR)
-
-cli:
- varlink call $(SOCKET_ADDR)/info.nispor.Get
-
clean:
cargo clean
make clean -C test/clib
-install: $(VARLINK_SRV_EXEC_RELEASE) $(CLI_EXEC_RELEASE)
- install -p -v -D -m755 $(VARLINK_SRV_EXEC_RELEASE) \
- $(DESTDIR)$(PREFIX)/bin/$(VARLINK_SRV_EXEC)
+install: $(CLI_EXEC_RELEASE)
install -p -v -D -m755 $(CLI_EXEC_RELEASE) \
$(DESTDIR)$(PREFIX)/bin/$(CLI_EXEC)
- install -p -v -D -m644 $(SYSTEMD_SOCKET_FILE) \
- $(DESTDIR)$(SYSTEMD_SYS_UNIT_DIR)/nispor.socket
- install -p -D -m644 $(SYSTEMD_SERVICE_FILE) \
- $(DESTDIR)$(SYSTEMD_SYS_UNIT_DIR)/nispor.service
install -p -D -m755 $(CLIB_SO_DEV_RELEASE) \
$(DESTDIR)$(LIBDIR)/$(CLIB_SO_FULL)
ln -sfv $(CLIB_SO_FULL) $(DESTDIR)$(LIBDIR)/$(CLIB_SO_MAN)
@@ -120,9 +97,7 @@ install: $(VARLINK_SRV_EXEC_RELEASE) $(CLI_EXEC_RELEASE)
uninstall:
- - rm -fv $(DESTDIR)$(PREFIX)/bin/$(VARLINK_SRV_EXEC)
- rm -fv $(DESTDIR)$(PREFIX)/bin/$(CLI_EXEC)
- - rm -fv $(DESTDIR)$(SYSTEMD_SYS_UNIT_DIR)/nispor*
- rm -fv $(DESTDIR)$(LIBDIR)/$(CLIB_SO_DEV)
- rm -fv $(DESTDIR)$(LIBDIR)/$(CLIB_SO_MAN)
- rm -fv $(DESTDIR)$(LIBDIR)/$(CLIB_SO_MIN)
diff --git a/README.md b/README.md
index 4a50e5e..c1eda2c 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,6 @@ Currently providing:
* Rust crate
* Python binding
* C binding
- * Varlink interface -- `npd`
* Command line tool -- `npc`
## Install
@@ -35,19 +34,6 @@ npc bond99
npc route
```
-### Varlink service
-
-```bash
-systemctl start nispor.socket
-```
-
-### Varlink client
-
-```bash
-# Please install `libvarlink-util` pacakge beforehand
-varlink call unix:/run/nispor/nispor.so/info.nispor.Get
-```
-
## Supported features
* IPv4/IPv6 address
* Bond
diff --git a/src/varlink/Cargo.toml b/src/varlink/Cargo.toml
deleted file mode 100644
index c8775d4..0000000
--- a/src/varlink/Cargo.toml
+++ /dev/null
@@ -1,17 +0,0 @@
-[package]
-name = "npd"
-version = "1.0.1"
-authors = ["Gris Ge <cnfourt@gmail.com>"]
-edition = "2018"
-
-[[bin]]
-name = "npd"
-path = "npd.rs"
-
-[dependencies]
-varlink = "11"
-serde = "1.0"
-serde_derive = "1.0"
-serde_json = "1.0"
-nispor = { path = "../lib" }
-libc = "0.2.71"
diff --git a/src/varlink/info.nispor.varlink b/src/varlink/info.nispor.varlink
deleted file mode 100644
index cc9b7d4..0000000
--- a/src/varlink/info.nispor.varlink
+++ /dev/null
@@ -1,263 +0,0 @@
-interface info.nispor
-
-type BondInfo (
- subordinates: []string,
- mode: []string,
- options: [string]string
-)
-
-type BridgeInfo (
- stp_state: (disabled, kernel_stp, user_stp, unknown),
- hello_time: int,
- forward_delay: int,
- max_age: int,
- priority: int,
- subordinates: []string,
- ageing_time: int,
- bridge_id: string,
- group_fwd_mask: int,
- root_id: string,
- root_port: int,
- root_path_cost: int,
- topology_change: bool,
- topology_change_detected: bool,
- hello_timer: int,
- tcn_timer: int,
- topology_change_timer: int,
- multicast_router: (disabled, temp_query, perm, temp, unknown),
- multicast_snooping: bool,
- multicast_query_use_ifaddr: bool,
- multicast_querier: bool,
- multicast_stats_enabled: bool,
- multicast_hash_elasticity: int,
- multicast_hash_max: int,
- multicast_last_member_count: int,
- multicast_startup_query_count: int,
- multicast_last_member_interval: int,
- multicast_membership_interval: int,
- multicast_querier_interval: int,
- multicast_query_interval: int,
- multicast_query_response_interval: int,
- multicast_startup_query_interval: int,
- multicast_igmp_version: int,
- multicast_mld_version: int,
- gc_timer: int,
- group_addr: string,
- nf_call_iptables: bool,
- nf_call_ip6tables: bool,
- nf_call_arptables: bool,
- vlan_filtering: bool,
- vlan_protocol: (802.1q, 802.1ad),
- ?default_pvid: int,
-)
-
-type BridgeVlanEntry (
- ?vid: int,
- ?vid_range: []int,
- is_pvid: bool,
- is_egress_untagged: bool,
-)
-
-type BridgePortInfo (
- stp_state: (disabled, listening, learning, forwarding, blocking, unknown),
- stp_priority: int,
- stp_path_cost: int,
- hairpin_mode: bool,
- bpdu_guard: bool,
- root_block: bool,
- multicast_fast_leave: bool,
- learning: bool,
- unicast_flood: bool,
- proxyarp: bool,
- proxyarp_wifi: bool,
- designated_root: string,
- designated_bridge: string,
- designated_port: int,
- designated_cost: int,
- port_id: string,
- port_no: string,
- change_ack: bool,
- config_pending: bool,
- message_age_timer: int,
- forward_delay_timer: int,
- hold_timer: int,
- multicast_router: (disabled, temp_query, perm, temp, unknown),
- multicast_flood: bool,
- multicast_to_unicast: bool,
- vlan_tunnel: bool,
- broadcast_flood: bool,
- group_fwd_mask: int,
- neigh_suppress: bool,
- isolated: bool,
- ?backup_port: string,
- ?vlans: []BridgeVlanEntry,
-)
-
-type Ipv4Info (
- addresses: []Ipv4AddrInfo
-)
-
-type Ipv4AddrInfo (
- address: string,
- prefix_len: int,
- ?peer: string,
- valid_lft: string,
- preferred_lft: string
-)
-
-type Ipv6Info (
- addresses: []Ipv6AddrInfo
-)
-
-type Ipv6AddrInfo (
- address: string,
- prefix_len: int,
- valid_lft: string,
- preferred_lft: string
-)
-
-type VlanInfo (
- vlan_id: int,
- protocol: (802.1q, 802.1ad, unknown),
- base_iface: string,
- is_reorder_hdr: bool,
- is_gvrp: bool,
- is_loose_binding: bool,
- is_mvrp: bool,
- is_bridge_binding: bool,
-)
-
-type VfState (
- rx_packets: int,
- tx_packets: int,
- rx_bytes: int,
- tx_bytes: int,
- broadcast: int,
- multicast: int,
- rx_dropped: int,
- tx_dropped: int,
-)
-
-type VfInfo (
- id: int,
- mac: string,
- broadcast: string,
- vlan_id: int,
- qos: int,
- tx_rate: int,
- spoof_check: int,
- link_state: (auto, enable, disable, unknown),
- min_tx_rate: int,
- max_tx_rate: int,
- query_rss: bool,
- state: VfState,
- trust: bool,
- ?ib_node_guid: string,
- ?ib_port_guid: string,
-)
-
-type SriovInfo (
- vfs: []VfInfo,
-)
-
-type TunInfo (
- mode: (tun, tap, unknown),
- pi: bool,
- vnet_hdr: bool,
- multi_queue: bool,
- persist: bool,
- ?owner: int,
- ?group: int,
- ?num_queues: int,
- ?num_disabled_queues: int,
-)
-
-type VethInfo (
- peer: string,
-)
-
-type VxlanInfo (
- remote: string,
- vxlan_id: int,
- base_iface: string,
- local: string,
- ttl: int,
- tos: int,
- learning: bool,
- ageing: int,
- max_address: int,
- src_port_min: int,
- src_port_max: int,
- proxy: bool,
- rsc: bool,
- l2miss: bool,
- l3miss: bool,
- dst_port: int,
- udp_check_sum: bool,
- udp6_zero_check_sum_tx: bool,
- udp6_zero_check_sum_rx: bool,
- remote_check_sum_tx: bool,
- remote_check_sum_rx: bool,
- gbp: bool,
- remote_check_sum_no_partial: bool,
- collect_metadata: bool,
- label: int,
- gpe: bool,
- ttl_inherit: bool,
- df: int,
-)
-
-type VrfInfo (
- table_id: int,
- subordinates: []string,
-)
-
-type VrfSubordinateInfo (
- table_id: int,
-)
-
-type MacVlanInfo (
- base_iface: string,
- mode: (private, vepa, bridge, passthru, source, unknown),
- flags: int,
- ?allowed_mac_addresses: []string,
-)
-
-type MacVtapInfo (
- base_iface: string,
- mode: (private, vepa, bridge, passthru, source, unknown),
- flags: int,
- ?allowed_mac_addresses: []string,
-)
-
-type Iface (
- name: string,
- iface_type: string,
- state: (Up, Down, Unknown),
- mtu: int,
- ?bond: BondInfo,
- ?bond_subordinate: [string]string,
- ?bridge: BridgeInfo,
- ?bridge_port: BridgePortInfo,
- ?vlan: VlanInfo,
- ?vxlan: VxlanInfo,
- ?sriov: SriovInfo,
- ?tun: TunInfo,
- ?veth: VethInfo,
- ?vrf: VrfInfo,
- ?vrf_subordinate: VrfSubordinateInfo,
- ?mac_vlan: MacVlanInfo,
- ?mac_vtap: MacVtapInfo,
- ?controller: string,
- ?controller_type: (bond, unknown),
- ?ipv4: Ipv4Info,
- ?ipv6: Ipv6Info
-)
-
-type NetState (
- ifaces: [string]Iface
-)
-
-method Get() -> (net_state: NetState)
-
-error InternalError(msg: string)
diff --git a/src/varlink/info_nispor.rs b/src/varlink/info_nispor.rs
deleted file mode 100644
index 1d614b5..0000000
--- a/src/varlink/info_nispor.rs
+++ /dev/null
@@ -1,228 +0,0 @@
-#![doc = "This file was automatically generated by the varlink rust generator"]
-#![allow(non_camel_case_types)]
-#![allow(non_snake_case)]
-use nispor::NetState;
-use serde_derive::{Deserialize, Serialize};
-use serde_json;
-use std::io::BufRead;
-use std::sync::{Arc, RwLock};
-use varlink::{self, CallTrait};
-
-#[allow(dead_code)]
-#[derive(Clone, PartialEq, Debug)]
-pub enum ErrorKind {
- Varlink_Error,
- VarlinkReply_Error,
- InternalError(Option<InternalError_Args>),
-}
-impl ::std::fmt::Display for ErrorKind {
- fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- match self {
- ErrorKind::Varlink_Error => write!(f, "Varlink Error"),
- ErrorKind::VarlinkReply_Error => write!(f, "Varlink error reply"),
- ErrorKind::InternalError(v) => {
- write!(f, "info.nispor.InternalError: {:#?}", v)
- }
- }
- }
-}
-pub struct Error(
- pub ErrorKind,
- pub Option<Box<dyn std::error::Error + 'static + Send + Sync>>,
- pub Option<&'static str>,
-);
-impl Error {
- #[allow(dead_code)]
- pub fn kind(&self) -> &ErrorKind {
- &self.0
- }
-}
-impl From<ErrorKind> for Error {
- fn from(e: ErrorKind) -> Self {
- Error(e, None, None)
- }
-}
-impl std::error::Error for Error {
- fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
- self.1
- .as_ref()
- .map(|e| e.as_ref() as &(dyn std::error::Error + 'static))
- }
-}
-impl std::fmt::Display for Error {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
- std::fmt::Display::fmt(&self.0, f)
- }
-}
-impl std::fmt::Debug for Error {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
- use std::error::Error as StdError;
- if let Some(ref o) = self.2 {
- std::fmt::Display::fmt(o, f)?;
- }
- std::fmt::Debug::fmt(&self.0, f)?;
- if let Some(e) = self.source() {
- std::fmt::Display::fmt("\nCaused by:\n", f)?;
- std::fmt::Debug::fmt(&e, f)?;
- }
- Ok(())
- }
-}
-#[allow(dead_code)]
-pub type Result<T> = std::result::Result<T, Error>;
-impl From<varlink::Error> for Error {
- fn from(e: varlink::Error) -> Self {
- match e.kind() {
- varlink::ErrorKind::VarlinkErrorReply(r) => Error(
- ErrorKind::from(r),
- Some(Box::from(e)),
- Some(concat!(file!(), ":", line!(), ": ")),
- ),
- _ => Error(
- ErrorKind::Varlink_Error,
- Some(Box::from(e)),
- Some(concat!(file!(), ":", line!(), ": ")),
- ),
- }
- }
-}
-#[allow(dead_code)]
-impl Error {
- pub fn source_varlink_kind(&self) -> Option<&varlink::ErrorKind> {
- use std::error::Error as StdError;
- let mut s: &dyn StdError = self;
- while let Some(c) = s.source() {
- let k = self
- .source()
- .and_then(|e| e.downcast_ref::<varlink::Error>())
- .and_then(|e| Some(e.kind()));
- if k.is_some() {
- return k;
- }
- s = c;
- }
- None
- }
-}
-impl From<&varlink::Reply> for ErrorKind {
- #[allow(unused_variables)]
- fn from(e: &varlink::Reply) -> Self {
- match e {
- varlink::Reply {
- error: Some(ref t), ..
- } if t == "info.nispor.InternalError" => match e {
- varlink::Reply {
- parameters: Some(p),
- ..
- } => match serde_json::from_value(p.clone()) {
- Ok(v) => ErrorKind::InternalError(v),
- Err(_) => ErrorKind::InternalError(None),
- },
- _ => ErrorKind::InternalError(None),
- },
- _ => ErrorKind::VarlinkReply_Error,
- }
- }
-}
-pub trait VarlinkCallError: varlink::CallTrait {
- fn reply_internal_error(&mut self, r#msg: String) -> varlink::Result<()> {
- self.reply_struct(varlink::Reply::error(
- "info.nispor.InternalError",
- Some(
- serde_json::to_value(InternalError_Args { r#msg })
- .map_err(varlink::map_context!())?,
- ),
- ))
- }
-}
-impl<'a> VarlinkCallError for varlink::Call<'a> {}
-#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
-pub struct InternalError_Args {
- pub r#msg: String,
-}
-#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
-pub struct Get_Reply {
- pub r#net_state: NetState,
-}
-impl varlink::VarlinkReply for Get_Reply {}
-#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
-pub struct Get_Args {}
-pub trait Call_Get: VarlinkCallError {
- fn reply(&mut self, r#net_state: NetState) -> varlink::Result<()> {
- self.reply_struct(Get_Reply { r#net_state }.into())
- }
-
- // TODO: Need better stuff
- fn fail(&mut self, msg: &str) -> varlink::Result<()> {
- self.reply_struct(varlink::Reply {
- continues: None,
- error: Some(format!("info.nispor.InternalError: {}", msg).into()),
- parameters: None,
- })
- }
-}
-impl<'a> Call_Get for varlink::Call<'a> {}
-pub trait VarlinkInterface {
- fn get(&self, call: &mut dyn Call_Get) -> varlink::Result<()>;
- fn call_upgraded(
- &self,
- _call: &mut varlink::Call,
- _bufreader: &mut dyn BufRead,
- ) -> varlink::Result<Vec<u8>> {
- Ok(Vec::new())
- }
-}
-pub trait VarlinkClientInterface {
- fn get(&mut self) -> varlink::MethodCall<Get_Args, Get_Reply, Error>;
-}
-#[allow(dead_code)]
-pub struct VarlinkClient {
- connection: Arc<RwLock<varlink::Connection>>,
-}
-impl VarlinkClient {
- #[allow(dead_code)]
- pub fn new(connection: Arc<RwLock<varlink::Connection>>) -> Self {
- VarlinkClient { connection }
- }
-}
-impl VarlinkClientInterface for VarlinkClient {
- fn get(&mut self) -> varlink::MethodCall<Get_Args, Get_Reply, Error> {
- varlink::MethodCall::<Get_Args, Get_Reply, Error>::new(
- self.connection.clone(),
- "info.nispor.Get",
- Get_Args {},
- )
- }
-}
-#[allow(dead_code)]
-pub struct VarlinkInterfaceProxy {
- inner: Box<dyn VarlinkInterface + Send + Sync>,
-}
-#[allow(dead_code)]
-pub fn new(
- inner: Box<dyn VarlinkInterface + Send + Sync>,
-) -> VarlinkInterfaceProxy {
- VarlinkInterfaceProxy { inner }
-}
-impl varlink::Interface for VarlinkInterfaceProxy {
- fn get_description(&self) -> &'static str {
- "interface info.nispor\n\ntype IfaceState (\n name: string,\n iface_type: string,\n state: (UP, DOWN, UNKNOWN),\n mtu: int\n)\n\ntype NetState (\n iface_states: [string]IfaceState\n)\n\n\nmethod Get() -> (net_state: NetState)\n\nerror InternalError(msg: string)\n"
- }
- fn get_name(&self) -> &'static str {
- "info.nispor"
- }
- fn call_upgraded(
- &self,
- call: &mut varlink::Call,
- bufreader: &mut dyn BufRead,
- ) -> varlink::Result<Vec<u8>> {
- self.inner.call_upgraded(call, bufreader)
- }
- fn call(&self, call: &mut varlink::Call) -> varlink::Result<()> {
- let req = call.request.unwrap();
- match req.method.as_ref() {
- "info.nispor.Get" => self.inner.get(call as &mut dyn Call_Get),
- m => call.reply_method_not_found(String::from(m)),
- }
- }
-}
diff --git a/src/varlink/npd.rs b/src/varlink/npd.rs
deleted file mode 100644
index 49e5d9b..0000000
--- a/src/varlink/npd.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-use libc::umask;
-use nispor::NetState;
-use std::process::exit;
-use varlink::{ListenConfig, VarlinkService};
-
-use crate::info_nispor::*;
-
-mod info_nispor;
-
-fn print_usage(program: &str) {
- println!("Usage: {} <varlink_address>", program);
-}
-
-fn main() {
- let args: Vec<_> = std::env::args().collect();
- if args.len() <= 1 {
- print_usage(&args[0]);
- exit(1);
- }
- run_server(&args[1]).unwrap();
- exit(0);
-}
-
-struct MyInfoGrisgeNispor {}
-
-impl VarlinkInterface for MyInfoGrisgeNispor {
- fn get(&self, call: &mut dyn Call_Get) -> varlink::Result<()> {
- match NetState::retrieve() {
- Ok(s) => call.reply(s),
- Err(e) => call.fail(&e.msg),
- }
- }
-}
-
-fn run_server(address: &str) -> varlink::Result<()> {
- let my_varlink_iface = info_nispor::new(Box::new(MyInfoGrisgeNispor {}));
- let service = VarlinkService::new(
- "info.nispor",
- "Network status query service",
- "0.1",
- "http://nispor.info",
- vec![Box::new(my_varlink_iface)],
- );
- // Make sure the socket file been created with permission 0666.
- let old_umask = unsafe { umask(0o111) };
- varlink::listen(service, &address, &ListenConfig::default())?;
- unsafe {
- umask(old_umask);
- }
- Ok(())
-}
diff --git a/src/varlink/systemd/nispor.service b/src/varlink/systemd/nispor.service
deleted file mode 100644
index 134cd88..0000000
--- a/src/varlink/systemd/nispor.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Network Inspector(nispor) varlink service
-
-[Service]
-ExecStart=/usr/bin/npd unix:/run/nispor/nispor.so
-DynamicUser=yes
-RuntimeDirectory=nispor
-
-[Install]
-Also=nispor.socket
diff --git a/src/varlink/systemd/nispor.socket b/src/varlink/systemd/nispor.socket
deleted file mode 100644
index f7d681b..0000000
--- a/src/varlink/systemd/nispor.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Network Inspector(nispor) varlink service
-PartOf=nispor.service
-
-[Socket]
-ListenStream=/run/nispor/nispor.so
-SocketMode=0666
-
-[Install]
-WantedBy=sockets.target
--
2.29.2

View File

@ -1,12 +1,13 @@
Name: nispor
Version: 1.0.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: API for network status querying
License: ASL 2.0
URL: https://github.com/nispor/nispor
Source: https://github.com/nispor/nispor/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}-%{version}-vendor.tar.xz
Patch0: BZ_1919986-bond-add-support-to-vlan-srcmac-tx-hashing-option.patch
Patch1: BZ_1926941-remove-the-varlink-support.patch
BuildRequires: pkg-config
BuildRequires: python3-devel
BuildRequires: rust-toolset
@ -54,14 +55,9 @@ popd
%post
/sbin/ldconfig
%systemd_post nispor.service
%preun
%systemd_preun nispor.service
%postun
/sbin/ldconfig
%systemd_postun_with_restart nispor.service
%install
env SKIP_PYTHON_INSTALL=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install
@ -74,10 +70,7 @@ popd
%doc AUTHORS CHANGELOG DEVEL.md README.md
%license LICENSE
%{_bindir}/npc
%{_bindir}/npd
%{_libdir}/libnispor.so.*
%{_unitdir}/nispor.socket
%{_unitdir}/nispor.service
%files -n python3-%{name}
%license LICENSE
@ -90,6 +83,9 @@ popd
%{_libdir}/pkgconfig/nispor.pc
%changelog
* Thu Feb 18 2021 Fernando Fernandez Mancera <ferferna@redhat.com> - 1.0.2-4
- Remove the varlink support. RHBZ#1926941
* Tue Feb 02 2021 Fernando Fernandez Mancera <ferferna@redhat.com> - 1.0.1-3
- Add support to bond vlan+srcmac tx hashing option. RHBZ#1919986