changeset 63:960fc3820613

fix Config
author riono <e165729@ie.u-ryukyu.ac.jp>
date Sat, 29 Jan 2022 17:31:31 +0900
parents 12b7528000da
children 83e02a762168
files Christie_net.csproj daemon/Config.cs topology/manager/TopologyManagerConfig.cs topology/node/TopologyNodeConfig.cs
diffstat 4 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Christie_net.csproj	Sat Jan 29 15:08:13 2022 +0900
+++ b/Christie_net.csproj	Sat Jan 29 17:31:31 2022 +0900
@@ -3,7 +3,7 @@
     <PropertyGroup>
         <OutputType>Exe</OutputType>
         <TargetFramework>netcoreapp6.0</TargetFramework>
-        <StartupObject>Christie_net.Test.Example.FizzBuzz.StartFizzBuzz</StartupObject>
+        <StartupObject>Christie_net.Test.Topology.TreeTestTopology.StartTreeTestTopology</StartupObject>
     </PropertyGroup>
 
     <ItemGroup>
--- a/daemon/Config.cs	Sat Jan 29 15:08:13 2022 +0900
+++ b/daemon/Config.cs	Sat Jan 29 17:31:31 2022 +0900
@@ -1,8 +1,31 @@
+using System.Net.Security;
+
 namespace Christie_net.daemon {
 public class Config {
     public int localPort = 10000;
     public string logFile = null;
     public string MCSTADDR = "224.0.0.1";
-        
+    //public AuthenticationLevel
+    public string nis = "en1";
+    public bool useKeepAlive = true;
+
+    public Config(string[] args) {
+        for (int i = 0; i< args.Length; i++) {
+            if ("--log".Equals(args[i])) {
+                logFile = args[++i];
+            } else if ("--localPort".Equals(args[i])) {
+                localPort = int.Parse(args[++i]);
+            } else if ("-n".Equals(args[i])) {
+                nis = args[++i];
+            } else if ("--noKeepAlive".Equals(args[i])) {
+                useKeepAlive = false;
+            } else if ("-a".Equals(args[i])) {
+                MCSTADDR = args[++i];
+            }
+            // else if ("--level") {
+            //     
+            // }
+        }
+    }
 }
 }
\ No newline at end of file
--- a/topology/manager/TopologyManagerConfig.cs	Sat Jan 29 15:08:13 2022 +0900
+++ b/topology/manager/TopologyManagerConfig.cs	Sat Jan 29 17:31:31 2022 +0900
@@ -10,7 +10,7 @@
         public TopologyType type = TopologyType.Tree;
         public int hasChild = 2;
 
-        public TopologyManagerConfig(String[] args) /*: base(args)*/ {
+        public TopologyManagerConfig(String[] args) : base(args) {
             for (int i = 0; i < args.Length; i++) {
                 if ("--confFile".Equals(args[i])) {
                     confFilePath = args[++i];
--- a/topology/node/TopologyNodeConfig.cs	Sat Jan 29 15:08:13 2022 +0900
+++ b/topology/node/TopologyNodeConfig.cs	Sat Jan 29 17:31:31 2022 +0900
@@ -12,7 +12,7 @@
         private String managerKey = "manager";
         private String localKey = "local";
 
-        public TopologyNodeConfig(String[] args) /*: base(args)*/{
+        public TopologyNodeConfig(String[] args) : base(args) {
             for (int i = 0; i< args.Length; i++) {
                 if ("--managerHost".Equals(args[i])) {
                     setManagerHostName(args[++i]);