Hi All,

I've just published raw-socket 1.1.8 to npm.

In this version the "Automatic Checksum Generation" feature has been 
removed and replaced with two functions, createChecksum() and 
writeChecksum().

These two functions provide greater control over checksum generation.  They 
provides the ability to create 16 bit checksums (as required by 
IP(v6)/TCP/UCP, etc.) from multiple Node.js Buffer objects (think TCP/UDP 
and psuedo IP headers) and to write the generated checksum to a Node.js 
Buffer object.

In previous code one would specify automatic checksum generation when 
creating a raw socket:

   var socket = raw.createSocket ({generateChecksums: true, ...});

With the new interface you would create and write your own checksums as and 
when you create packets:

   // ICMP checksums are at offset 2 and 3, i.e. bytes 3 and 4
   var icmp_packet = new Buffer ([...]);
   raw.writeChecksum (icmp_packet, 2, raw.createChecksum (icmp_packet));

This change does break existing code - hence this announcement - but the 
newer interface is much cleaner and (in my opinion) de-coupled, and I 
wanted to remove the old interface for some time now.

The net-ping module has been updated to use this new interface.

Recently the htonl(), htons(), ntohl() and ntohs() functions were also 
added to raw-socket, to expose functions with the same name for your 
operating system, I thought this was a natural addition given then when 
dealing with this module you typically need to manipulate buffers to 
produce data in network byte order.

Thanks

Steve

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to