[prev in list] [next in list] [prev in thread] [next in thread] 

List:       os-sim-commits
Subject:    [Os-sim-commits] os-sim/src sim-command.c,1.77,1.78
From:       Alberto Roman Linacero <alberto_r () users ! sourceforge ! net>
Date:       2007-01-23 19:05:56
Message-ID: E1H9Qy6-0005pa-8N () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/os-sim/os-sim/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv886

Modified Files:
	sim-command.c 
Log Message:
-server sends absolute=false in watch_rules (clarification)


Index: sim-command.c
===================================================================
RCS file: /cvsroot/os-sim/os-sim/src/sim-command.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- sim-command.c	3 Nov 2006 13:34:34 -0000	1.77
+++ sim-command.c	23 Jan 2007 19:05:53 -0000	1.78
@@ -1159,6 +1159,27 @@
       g_string_append_printf (str, "value=\"%s\" ", value);
     }
 
+	/* Interval */
+  interval = sim_rule_get_interval (rule);
+  if (interval > 0)
+    {
+      g_string_append_printf (str, "interval=\"%d\" ", interval);
+    }
+
+  /* Absolute */
+  absolute = sim_rule_get_absolute (rule);
+	if (interval > 0)
+	{
+		if (absolute)
+      str = g_string_append (str, "absolute=\"true\"");
+		else
+      str = g_string_append (str, "absolute=\"false\"");
+	}
+	else	//if interval is 0, that implies that absolute is true, as we don't have any \
time to compare with it. We only are able to +				//know when the "value" as been \
reached (ie. when somebody has reached 100 network packets), but it can spend as much \
time as it wants. +	  str = g_string_append (str, "absolute=\"true\"");
+
+
   /* PORT FROM */
   list = sim_rule_get_src_ports (rule);
   if (list)
@@ -1195,12 +1216,6 @@
       list = list->next;
     }
 
-  /* Interval */
-  interval = sim_rule_get_interval (rule);
-  if (interval > 0)
-    {
-      g_string_append_printf (str, "interval=\"%d\" ", interval);
-    }
 
   /* SRC IAS */
   list = sim_rule_get_src_inets (rule);
@@ -1242,13 +1257,6 @@
       list = list->next;
     }
 
-  /* Absolute */
-  absolute = sim_rule_get_absolute (rule);
-  if (absolute)
-    {
-      str = g_string_append (str, "absolute=\"true\"");
-    }
-
   str = g_string_append (str, "\n");
 
   command->data.watch_rule.str = g_string_free (str, FALSE); //free the GString \
object and returns the string


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Os-sim-commits mailing list
Os-sim-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/os-sim-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic