Subject: | Updates for libnids-1.19 |
Here's a patch that updates Net::LibNIDS slightly. Versions of
Show quoted text
>=libnids-1.19 include the patch that was provided with Net::LibNIDS
0.01. This enables export of the previous packet header, used for timing.
libnids does not #define the name that was used previously, so
NIDS_MINOR is tested instead as a version check.
Currently, all 4 tests run successfully. However, I haven't got round
to trying the module yet as I needed to fix this up first. More testing
is needed and possible some perl magic, make reports "Please specify
prototyping behavior for LibNIDS.xs (see perlxs manual)" which should
probably be sorted.
Version 1.19 of libnids was released in 2004, so there should be no
problems with availability! I propose that the previously used patch is
removed from the distribution.
I have also fixed a few typos.
Subject: | update-for-newer-libnids.patch |
diff -u Net-LibNIDS-0.01/Changes Net-LibNIDS-0.02/Changes
--- Net-LibNIDS-0.01/Changes 2008-03-29 21:59:48.000000000 +0000
+++ Net-LibNIDS-0.02/Changes 2008-03-29 21:59:48.000000000 +0000
@@ -1,5 +1,8 @@
Revision history for Perl extension Lib::nids.
+0.02 Sat Mar 29 12:00:00 2008
+ - updated now that libnids exports last_hdr by default
+
0.01 Sat Jun 12 12:13:38 2004
- original version; created by h2xs 1.22 with options
-a -a --name=Lib::nids --use-new-tests --skip-exporter --skip-autoloader /Users/sky/Documents/Projects/perlnids/include/nids.h
diff -u Net-LibNIDS-0.01/LibNIDS.pm Net-LibNIDS-0.02/LibNIDS.pm
--- Net-LibNIDS-0.01/LibNIDS.pm 2008-03-29 21:59:48.000000000 +0000
+++ Net-LibNIDS-0.02/LibNIDS.pm 2008-03-29 22:45:54.000000000 +0000
@@ -7,7 +7,7 @@
our @ISA = qw();
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -85,7 +85,7 @@
=head1 DESCRIPTION
-The workflow of using libnids is to set all paremeters, then call init, set up a callback then run.
+The workflow of using libnids is to set all parameters, then call init, set up a callback then run.
=head1 Net::LibNIDS::init( )
@@ -149,15 +149,15 @@
=head2 $tcp_stream->lastpacket_sec
-Returns the seconds from epoch that this packet was recorded. Only available if libnids was compiled with the patch that comes with this package.
+Returns the seconds from epoch that this packet was recorded. Only available with libnids version >= 1.19.
=head2 $tcp_stream->lastpacket_usec
-Returns the microsecond fraction that this packet was recorded. Used together with $tcp_stream->lastpacket to get the most correct timestamp possible. Only available if libnids was compiled with the patch that comes with this package.
+Returns the microsecond fraction that this packet was recorded. Used together with $tcp_stream->lastpacket to get the most correct timestamp possible. Only available with libnids version >= 1.19.
=head2 $tcp_stream->server $tcp_stream->client
-Returns a Net::LibNIDS::tcp_stream::half object, corresponding for the client hald and the server half.
+Returns a Net::LibNIDS::tcp_stream::half object, corresponding for the client half and the server half.
=head1 Net::LibNIDS::tcp_stream::half
@@ -307,6 +307,10 @@
Not currently supported by this extension
+=head2 Note
+
+Previous versions of Net::LibNIDS included a patch against libnids in order to obtain packet timings. This is no longer necessary as long as libnids-1.19 or greater is used.
+
=head1 SEE ALSO
libnids man page
@@ -317,6 +321,7 @@
=head1 AUTHOR
Arthur Bergman, E<lt>sky@nanisky.comE<gt>
+Modified for libnids >= 1.19 by David Cannings, E<lt>david@edeca.netE<gt>
=head1 COPYRIGHT AND LICENSE
diff -u Net-LibNIDS-0.01/LibNIDS.xs Net-LibNIDS-0.02/LibNIDS.xs
--- Net-LibNIDS-0.01/LibNIDS.xs 2008-03-29 21:59:48.000000000 +0000
+++ Net-LibNIDS-0.02/LibNIDS.xs 2008-03-29 22:44:15.000000000 +0000
@@ -80,12 +80,13 @@
MODULE = Net::LibNIDS PACKAGE = Net::LibNIDS::tcp_stream
-#ifdef NIDS_SAVES_LAST_PCAP_HDR
+# Export of last_pcap_header was added in libnids-1.19
+#if NIDS_MINOR>=19
IV
lastpacket_sec(obj)
SV* obj
CODE:
- RETVAL = last_pcap_header->ts.tv_sec;
+ RETVAL = nids_last_pcap_header->ts.tv_sec;
OUTPUT:
RETVAL
@@ -93,7 +94,7 @@
lastpacket_usec(obj)
SV* obj
CODE:
- RETVAL = last_pcap_header->ts.tv_usec;
+ RETVAL = nids_last_pcap_header->ts.tv_usec;
OUTPUT:
RETVAL
diff -u Net-LibNIDS-0.01/META.yml Net-LibNIDS-0.02/META.yml
--- Net-LibNIDS-0.01/META.yml 2008-03-29 21:59:48.000000000 +0000
+++ Net-LibNIDS-0.02/META.yml 2008-03-29 21:59:48.000000000 +0000
@@ -1,6 +1,6 @@
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Net-LibNIDS
-version: 0.01
+version: 0.02
version_from: LibNIDS.pm
installdirs: site
requires: