epoch1970;603556 Wrote: 
> I you think my suggestion is worth your time, feel free to implement it
> in a sane way for everyone in the plugin. And thanks again for spotting
> the bug on bytes/pkts ;)
> BTW, I think I've been using "pack" inappropriately. What I believe but
> never got to implement and test is, in plain terms: i. pipes should be
> efficiently stored as bytes with 1/0 measures as bits; ii. once this is
> done making endianness enter the dance when evaluating the pipe would
> make for a smarter vote.
> 
> There are 2 independent issues indeed. I figured bwm-ng was nice,
> despite its improbable name, due to the fact it was ported to so many
> platforms. On the mac the best I can do for now is calling "netstat -s
> -f inet". Not too bad, but you can start cooking another set of
> map/grep…
> Maybe you want to stick to calling this util (or some other, or derive
> from this base, or …) ?
Ok, I'm working on "binary pipes".  I'm a little confused as to how 32
bit perl handles shifts left greater than 32.  E.g.:


Code:
--------------------
    
  #!/usr/bin/perl -w
  
  my $topbit1 = (1 << 31);
  my $topbit2 = (1 << 32);
  
  printf("topb1: %#010llx     %#064llb    %015llu\n", $topbit1, $topbit1, 
$topbit1 );
  printf("topb2: %#010llx     %#064llb    %015llu\n", $topbit2, $topbit2, 
$topbit2 );
  
  if ($topbit2 >= $topbit1) {
  print "Hey!\n";
  }
  
  $topbit1 = 0xFFFFFFFF;
  $topbit2 = $topbit1;
  $topbit2 <<= 1;
  $topbit2 |= 1;
  
  printf("topb1: %#010llx     %#064llb    %015llu\n", $topbit1, $topbit1, 
$topbit1 );
  printf("topb2: %#010llx     %#064llb    %015llu\n", $topbit2, $topbit2, 
$topbit2 );
  
  if ($topbit2 > $topbit1) {
  print "Hey!\n";
  }
--------------------


..yields:

Code:
--------------------
    
  topb1: 0x80000000     
0b00000000000000000000000000000010000000000000000000000000000000    
000002147483648
  topb2: 0x00000001     
0b00000000000000000000000000000000000000000000000000000000000001    
000000000000001
  topb1: 0xffffffff     
0b00000000000000000000000000000011111111111111111111111111111111    
000004294967295
  topb2: 0xffffffff     
0b00000000000000000000000000000011111111111111111111111111111111    
000004294967295
  
--------------------

So...I think we're stuck in the world of 32bit unsigned ints.  Which
means that if we want a pipe "window" larger than 32, we're talking
about using an array of 2 or more unsigned ints for the pipe.


-- 
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=49028

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to