diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | src/config.rs | 4 | ||||
| -rw-r--r-- | src/geoparsers/geoip2.rs | 5 |
3 files changed, 6 insertions, 5 deletions
@@ -2,4 +2,4 @@ Tun-in interface with marching on TOR/I2P similar to v2ray/xray -The project is designed by the desire to transfer all the charms of routing and tun-in of modern VPN cores to Mesh networks.
\ No newline at end of file +The project is designed by the desire to transfer all the charms of routing and tun-in of modern VPN cores to Mesh networks. diff --git a/src/config.rs b/src/config.rs index 85f4e81..ec4e92c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,9 +11,9 @@ pub enum RunTypes { pub struct NSCConfig { /// Paths to v2ray `geosite.dat', `geoip.dat` pub geo_files: [String; 2], - /// Routing settings similar to v2ray + /// Routing settings similar to v2ray pub routing: String, - /// TOR/I2P Proxies + /// TOR/I2P Proxies pub mode: RunTypes, } diff --git a/src/geoparsers/geoip2.rs b/src/geoparsers/geoip2.rs index 9e8f29d..39ad79d 100644 --- a/src/geoparsers/geoip2.rs +++ b/src/geoparsers/geoip2.rs @@ -16,6 +16,8 @@ pub enum RouteAction { Direct, } +type Rules = Vec<Rule>; + /// Type for declaring the routing rules like: /// ```toml /// [rule] @@ -31,9 +33,8 @@ pub struct Rule { pub action: RouteAction, } -pub fn parse_ruleset(config: NSCConfig) -> Result<Vec<Rule>, Box<dyn std::error::Error>> { +pub fn parse_ruleset(config: NSCConfig) -> Result<Rules, Box<dyn std::error::Error>> { let reader = maxminddb::Reader::open_readfile(config.geo_files[0].clone())?; - // Ok(()) todo!(); |
