rb-wartslib 0.9.13 → 0.9.14

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ version 0.9.14, 2008-03-17
2
+ * fixed to compile under Linux
3
+ * fixed to handle traces with a NULL source address; scamper can sometimes
4
+ write out traces with a NULL source address when a serious error occurs
5
+ (stop reason == 6, ERROR)
6
+
1
7
  version 0.9.13, 2008-02-01
2
8
  * fixed Warts::File#open to handle paths with spaces and other special
3
9
  characters
@@ -78,7 +78,7 @@ Although you can use this extension to write out trace data to warts files,
78
78
  you can't use this extension itself to create completely new traces in
79
79
  memory--that is, you can only write out traces you've read in from a file.
80
80
  Furthermore, any read-in data is immutable, with a few careful exceptions,
81
- because the principle purpose of this extension is to support the analysis
81
+ because the principal purpose of this extension is to support the analysis
82
82
  of existing data rather than the creation of new data. The ability to
83
83
  write out (unmodified) traces is still useful for filtering out traces and
84
84
  for re-organizing traces into a different set of files (for example, into
@@ -377,17 +377,17 @@ timestamp.
377
377
 
378
378
  <h3>Instance Methods</h3>
379
379
 
380
- <h4 class="method_sig"><a name="Trace_src_cmp_method"></a><span class="method_name">src_cmp</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
380
+ <h4 class="method_sig"><a name="Trace_src_cmp_method"></a><span class="method_name">src_cmp</span>(<span class="method_argument">other_trace</span>)</h4>
381
381
 
382
382
  <p class="method_desc">
383
383
  </p>
384
384
 
385
- <h4 class="method_sig"><a name="Trace_dest_cmp_method"></a><span class="method_name">dest_cmp</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
385
+ <h4 class="method_sig"><a name="Trace_dest_cmp_method"></a><span class="method_name">dest_cmp</span>(<span class="method_argument">other_trace</span>)</h4>
386
386
 
387
387
  <p class="method_desc">
388
388
  </p>
389
389
 
390
- <h4 class="method_sig"><a name="Trace_cycle=_method"></a><span class="method_name">cycle=</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
390
+ <h4 class="method_sig"><a name="Trace_cycle=_method"></a><span class="method_name">cycle=</span>(<span class="method_argument">cycle</span>)</h4>
391
391
 
392
392
  <p class="method_desc">
393
393
  </p>
@@ -402,37 +402,37 @@ timestamp.
402
402
  <p class="method_desc">
403
403
  </p>
404
404
 
405
- <h4 class="method_sig"><a name="Trace_find_dest_response_method"></a><span class="method_name">find_dest_response</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
405
+ <h4 class="method_sig"><a name="Trace_find_dest_response_method"></a><span class="method_name">find_dest_response</span></h4>
406
406
 
407
407
  <p class="method_desc">
408
408
  </p>
409
409
 
410
- <h4 class="method_sig"><a name="Trace_complete?_method"></a><span class="method_name">complete?</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
410
+ <h4 class="method_sig"><a name="Trace_complete?_method"></a><span class="method_name">complete?</span></h4>
411
411
 
412
412
  <p class="method_desc">
413
413
  </p>
414
414
 
415
- <h4 class="method_sig"><a name="Trace_each_hop_method"></a><span class="method_name">each_hop</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
415
+ <h4 class="method_sig"><a name="Trace_each_hop_method"></a><span class="method_name">each_hop</span></h4>
416
416
 
417
417
  <p class="method_desc">
418
418
  </p>
419
419
 
420
- <h4 class="method_sig"><a name="Trace_each_response_method"></a><span class="method_name">each_response</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
420
+ <h4 class="method_sig"><a name="Trace_each_response_method"></a><span class="method_name">each_response</span>(<span class="method_argument">hop_index</span>)</h4>
421
421
 
422
422
  <p class="method_desc">
423
423
  </p>
424
424
 
425
- <h4 class="method_sig"><a name="Trace_each_hop_and_response_method"></a><span class="method_name">each_hop_and_response</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
425
+ <h4 class="method_sig"><a name="Trace_each_hop_and_response_method"></a><span class="method_name">each_hop_and_response</span></h4>
426
426
 
427
427
  <p class="method_desc">
428
428
  </p>
429
429
 
430
- <h4 class="method_sig"><a name="Trace_dest_responded?_method"></a><span class="method_name">dest_responded?</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
430
+ <h4 class="method_sig"><a name="Trace_dest_responded?_method"></a><span class="method_name">dest_responded?</span></h4>
431
431
 
432
432
  <p class="method_desc">
433
433
  </p>
434
434
 
435
- <h4 class="method_sig"><a name="Trace_each_method"></a><span class="method_name">each</span>(<span class="method_argument">hop_index</span>, <span class="method_argument">response_index</span><code class="method_default">=0</code>)</h4>
435
+ <h4 class="method_sig"><a name="Trace_each_method"></a><span class="method_name">each</span></h4>
436
436
 
437
437
  <p class="method_desc">
438
438
  </p>
@@ -18,12 +18,12 @@
18
18
  ** along with this program; if not, write to the Free Software
19
19
  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
20
  **
21
- ** $Id: scaddr.c,v 1.9 2007/11/29 01:42:07 youngh Exp $
21
+ ** $Id: scaddr.c,v 1.10 2008/02/08 23:46:56 youngh Exp $
22
22
  **/
23
23
 
24
24
  #include "ruby.h"
25
25
 
26
- #if defined(__HAVE_STDINT_H__)
26
+ #if defined(HAVE_STDINT_H)
27
27
  #include <stdint.h>
28
28
  #endif
29
29
 
@@ -19,12 +19,12 @@
19
19
  ** along with this program; if not, write to the Free Software
20
20
  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
21
  **
22
- ** $Id: scext.c,v 1.24 2008/01/25 01:15:46 youngh Exp $
22
+ ** $Id: scext.c,v 1.26 2008/02/08 23:46:56 youngh Exp $
23
23
  **/
24
24
 
25
25
  #include "ruby.h"
26
26
 
27
- #if defined(__HAVE_STDINT_H__)
27
+ #if defined(HAVE_STDINT_H)
28
28
  #include <stdint.h>
29
29
  #endif
30
30
 
@@ -42,7 +42,7 @@ void Init_wartslibext(void)
42
42
  {
43
43
  mWarts = rb_define_module("Warts");
44
44
 
45
- rb_define_const(mWarts, "WARTS_LIB_VERSION", rb_str_new2("0.9.13"));
45
+ rb_define_const(mWarts, "WARTS_LIB_VERSION", rb_str_new2("0.9.14"));
46
46
  rb_define_const(mWarts, "SCAMPER_VERSION", rb_str_new2(SCAMPER_VERSION));
47
47
 
48
48
  rb_define_const(mWarts, "LIST", INT2FIX(SCAMPER_FILE_OBJ_LIST));
@@ -18,22 +18,22 @@
18
18
  ** along with this program; if not, write to the Free Software
19
19
  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
20
  **
21
- ** $Id: scfile.c,v 1.33 2008/01/25 01:15:20 youngh Exp $
21
+ ** $Id: scfile.c,v 1.35 2008/02/08 23:46:56 youngh Exp $
22
22
  **/
23
23
 
24
24
  #include <unistd.h>
25
25
  #include <string.h>
26
26
  #include <strings.h>
27
27
 
28
+ #if defined(HAVE_STDINT_H)
29
+ #include <stdint.h>
30
+ #endif
31
+
28
32
  #include "ruby.h"
29
33
 
30
34
  #include "scfile.h"
31
35
  #include "scaddr.h"
32
36
 
33
- #if defined(__HAVE_STDINT_H__)
34
- #include <stdint.h>
35
- #endif
36
-
37
37
  #include "scamper_list.h"
38
38
  #include "scamper_addr.h"
39
39
  #include "scamper_trace.h"
@@ -18,14 +18,14 @@
18
18
  ** along with this program; if not, write to the Free Software
19
19
  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
20
  **
21
- ** $Id: sclist.c,v 1.10 2007/11/29 01:42:07 youngh Exp $
21
+ ** $Id: sclist.c,v 1.11 2008/02/08 23:46:56 youngh Exp $
22
22
  **/
23
23
 
24
24
  #include <stdlib.h>
25
25
  #include <string.h>
26
26
  #include "ruby.h"
27
27
 
28
- #if defined(__HAVE_STDINT_H__)
28
+ #if defined(HAVE_STDINT_H)
29
29
  #include <stdint.h>
30
30
  #endif
31
31
 
@@ -27,12 +27,12 @@
27
27
  ** along with this program; if not, write to the Free Software
28
28
  ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
29
  **
30
- ** $Id: sctrace.c,v 1.59 2008/01/25 00:17:32 youngh Exp $
30
+ ** $Id: sctrace.c,v 1.61 2008/02/14 00:00:48 youngh Exp $
31
31
  **/
32
32
 
33
33
  #include "ruby.h"
34
34
 
35
- #if defined(__HAVE_STDINT_H__)
35
+ #if defined(HAVE_STDINT_H)
36
36
  #include <stdint.h>
37
37
  #endif
38
38
 
@@ -406,13 +406,19 @@ static VALUE sctrace_init(VALUE self)
406
406
  }
407
407
 
408
408
 
409
+ /*
410
+ ** NOTE: scamper can sometimes write out traces with a NULL source address.
411
+ ** This seems to happen when a serious error occurs (stop reason == 6,
412
+ ** ERROR). We tolerate this by return nil for the src address.
413
+ */
409
414
  static VALUE sctrace_src(VALUE self)
410
415
  {
411
416
  scamper_trace_t *trace;
412
417
  char buf[128];
413
418
 
414
419
  Data_Get_Struct(self, scamper_trace_t, trace);
415
- return rb_str_new2(scamper_addr_tostr(trace->src, buf, 128));
420
+ return (trace->src ? rb_str_new2(scamper_addr_tostr(trace->src, buf, 128))
421
+ : Qnil);
416
422
  }
417
423
 
418
424
 
@@ -426,6 +432,12 @@ static VALUE sctrace_dest(VALUE self)
426
432
  }
427
433
 
428
434
 
435
+ /*
436
+ ** NOTE: scamper can sometimes write out traces with a NULL source address.
437
+ ** See sctrace_src(). For comparison purposes, a NULL source address
438
+ ** is considered less than any other address except for another NULL
439
+ ** source address. Two NULL addresses are equal.
440
+ */
429
441
  static VALUE sctrace_src_cmp(VALUE self, VALUE other)
430
442
  {
431
443
  scamper_trace_t *self_trace;
@@ -442,7 +454,19 @@ static VALUE sctrace_src_cmp(VALUE self, VALUE other)
442
454
 
443
455
  Data_Get_Struct(self, scamper_trace_t, self_trace);
444
456
  Data_Get_Struct(other, scamper_trace_t, other_trace);
445
- return INT2FIX(scamper_addr_cmp(self_trace->src, other_trace->src));
457
+
458
+ if (self_trace->src && other_trace->src) {
459
+ return INT2FIX(scamper_addr_cmp(self_trace->src, other_trace->src));
460
+ }
461
+ else if (self_trace->src) {
462
+ return INT2FIX(1);
463
+ }
464
+ else if (other_trace->src) {
465
+ return INT2FIX(-1);
466
+ }
467
+ else {
468
+ return INT2FIX(0);
469
+ }
446
470
  }
447
471
 
448
472
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rb-wartslib
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.13
7
- date: 2008-02-01 00:00:00 -08:00
6
+ version: 0.9.14
7
+ date: 2008-03-17 00:00:00 -07:00
8
8
  summary: Ruby extension for reading/writing warts files
9
9
  require_paths:
10
10
  - lib