summaryrefslogtreecommitdiff
path: root/net/sniffit
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2012-03-31 08:31:06 +0000
committerdholland <dholland@pkgsrc.org>2012-03-31 08:31:06 +0000
commit4aa9d9801aee455124dc5a7012e0e734f7c6012c (patch)
tree566cbd80b3aaeee3326fa801340db39ccec7e036 /net/sniffit
parentb93ef47c339c4f57eea8fd6751b114aea4b85fa0 (diff)
downloadpkgsrc-4aa9d9801aee455124dc5a7012e0e734f7c6012c.tar.gz
Patch up various lethal compiler warnings. This still doesn't build
on NetBSD current or probably -6 because of bpf issues, but now stands a chance of being able to run on LP64 platforms and/or at all when that's fixed.
Diffstat (limited to 'net/sniffit')
-rw-r--r--net/sniffit/distinfo10
-rw-r--r--net/sniffit/patches/patch-ai59
-rw-r--r--net/sniffit/patches/patch-ak21
-rw-r--r--net/sniffit/patches/patch-sn__cfgfile_c15
-rw-r--r--net/sniffit/patches/patch-sn__cfgfile_h14
-rw-r--r--net/sniffit/patches/patch-sn__logfile_c25
-rw-r--r--net/sniffit/patches/patch-sniffit_h25
7 files changed, 157 insertions, 12 deletions
diff --git a/net/sniffit/distinfo b/net/sniffit/distinfo
index 614b333d8e9..377139f0cfc 100644
--- a/net/sniffit/distinfo
+++ b/net/sniffit/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2006/01/25 17:30:55 joerg Exp $
+$NetBSD: distinfo,v 1.11 2012/03/31 08:31:06 dholland Exp $
SHA1 (sniffit.0.3.5.tar.gz) = df9183fca2eec29a56bcfdc68a983c4e7d57bf9d
RMD160 (sniffit.0.3.5.tar.gz) = 9508f357c6fe74a9147a735fd0eb419b9a1124eb
@@ -8,6 +8,10 @@ SHA1 (patch-ac) = 05ab42b3499edd550de6f1bb667adce34e26a503
SHA1 (patch-ad) = 302391b40bbfe6f218136778738572109be3ce6b
SHA1 (patch-ae) = c430e434309135189de7b3e61e4d0a1e63e50426
SHA1 (patch-ah) = 50959ea602f9c31bd71a966b1c4b1903db2711d5
-SHA1 (patch-ai) = 35fc26728c08a73b44064f225096e3d0e59a9e5b
+SHA1 (patch-ai) = d8e5641d1fd729feea93d3b0a8b4d24e12ce9954
SHA1 (patch-aj) = db87dccf1c952e188aebb7bbb699c6257287c87d
-SHA1 (patch-ak) = 1b924bf9e336f57b75911c0bc9d32ab9b667c9b0
+SHA1 (patch-ak) = 6909bb66b1ce6f9a4a78b548d00c41b1b0845d56
+SHA1 (patch-sn__cfgfile_c) = ae761ad7ec853d86a5dc458e47271125e8b75555
+SHA1 (patch-sn__cfgfile_h) = 40dd73a556d0a48576baaa00b7ab8be5fbbf48eb
+SHA1 (patch-sn__logfile_c) = 07248e3ebd524a4f4f10f1d9b6aee33c70c5457f
+SHA1 (patch-sniffit_h) = 84166a2ab540a1ab9ab5b5940c9dbd57514fea24
diff --git a/net/sniffit/patches/patch-ai b/net/sniffit/patches/patch-ai
index 6b1facf7be3..8b4597ed3fd 100644
--- a/net/sniffit/patches/patch-ai
+++ b/net/sniffit/patches/patch-ai
@@ -1,8 +1,50 @@
-$NetBSD: patch-ai,v 1.1 2006/01/08 11:02:10 wiz Exp $
+$NetBSD: patch-ai,v 1.2 2012/03/31 08:31:06 dholland Exp $
---- sniffit.0.3.5.c.orig 1997-04-18 11:33:58.000000000 +0200
+- use standard headers
+- fix signature of signal handler, make it file-static
+- fix signature of pcap handler
+- make const declarations internally consistent
+- CORRUPT_IP/DONT_EXAMINE changes from a long time ago
+
+--- sniffit.0.3.5.c.orig 1997-04-18 09:33:58.000000000 +0000
+++ sniffit.0.3.5.c
-@@ -411,11 +411,17 @@ int check_packet(unsigned long ipaddr,
+@@ -7,6 +7,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <netdb.h>
+ #include <errno.h>
+ #include <sys/stat.h>
+@@ -93,7 +95,7 @@ printf(" 9 -- %s\n",PLUGIN9_NAME);
+ exit(0);
+ }
+
+-void my_exit (void) { exit(0);};
++static void my_exit (int sig) { exit(0);};
+
+ /* DEBUGGING INFO */
+ #ifdef DEBUG
+@@ -298,7 +300,7 @@ struct file_info *search_dynam(char *fil
+
+ /* Type 0: TELNET */
+ void record_buf(struct file_info *dummy_pointer, unsigned long cur_seq_nr,
+- char *data, int len, int type)
++ const char *data, int len, int type)
+ {
+ int i,j,noloop=0;
+
+@@ -337,7 +339,7 @@ for(i=1;i<SCBUF;i++)
+ }
+
+ void sbuf_update(struct file_info *dummy_pointer, unsigned long cur_seq_nr,
+- char *data, int len)
++ const char *data, int len)
+ {
+ int i;
+
+@@ -411,11 +413,17 @@ int check_packet(unsigned long ipaddr,
proto=unwrap_packet(sp, info);
if(proto == NO_IP) return DONT_EXAMINE; /* no use in trying */
if(proto == NO_IP_4) return DONT_EXAMINE; /* no use in trying */
@@ -20,7 +62,7 @@ $NetBSD: patch-ai,v 1.1 2006/01/08 11:02:10 wiz Exp $
if((proto==TCP)&&(PROTOCOLS&F_TCP))
{
#ifdef DEBUG_ONSCREEN
-@@ -1220,6 +1226,10 @@ int check_mask (const struct packetheade
+@@ -1220,6 +1228,10 @@ int check_mask (const struct packetheade
proto=unwrap_packet(sp, info);
if(proto == NO_IP) return DONT_EXAMINE; /* no use in trying */
if(proto == NO_IP_4) return DONT_EXAMINE; /* no use in trying */
@@ -31,3 +73,12 @@ $NetBSD: patch-ai,v 1.1 2006/01/08 11:02:10 wiz Exp $
(*IP_nr_of_packets)++;
if(proto==ICMP)
+@@ -1272,7 +1284,7 @@ int check_mask (const struct packetheade
+ return TCP_EXAMINE; /* interprete packet */
+ }
+
+-pcap_handler interactive_packethandler( char *dummy,
++pcap_handler interactive_packethandler( unsigned char *dummy,
+ const struct packetheader *p_header,
+ const unsigned char *sp)
+ {
diff --git a/net/sniffit/patches/patch-ak b/net/sniffit/patches/patch-ak
index 5fdc14e1abb..87b2771987d 100644
--- a/net/sniffit/patches/patch-ak
+++ b/net/sniffit/patches/patch-ak
@@ -1,8 +1,19 @@
-$NetBSD: patch-ak,v 1.1 2006/01/08 11:02:10 wiz Exp $
+$NetBSD: patch-ak,v 1.2 2012/03/31 08:31:06 dholland Exp $
---- sn_packets.c.orig 1997-04-18 11:33:58.000000000 +0200
+- use standard headers
+- unclear other changes from a long time back
+
+--- sn_packets.c.orig 1997-04-18 09:33:58.000000000 +0000
+++ sn_packets.c
-@@ -43,6 +43,7 @@ int unwrap_packet (unsigned char *sp, st
+@@ -4,6 +4,7 @@
+ #include "sn_config.h"
+ #include "sn_defines.h"
+ #include "sn_structs.h"
++#include <string.h>
+ #include <netinet/in.h>
+
+ extern int PROTO_HEAD;
+@@ -43,6 +44,7 @@ int unwrap_packet (unsigned char *sp, st
struct UDP_header UDPhead;
int i;
@@ -10,7 +21,7 @@ $NetBSD: patch-ak,v 1.1 2006/01/08 11:02:10 wiz Exp $
memcpy(&IPhead,(sp+PROTO_HEAD),sizeof(struct IP_header));
/* IP header Conversion */
-@@ -51,6 +52,7 @@ int unwrap_packet (unsigned char *sp, st
+@@ -51,6 +53,7 @@ int unwrap_packet (unsigned char *sp, st
unwrapped->TCP_len = 0; /* Reset structure NEEDED!!! */
unwrapped->UDP_len = 0;
unwrapped->DATA_len = 0;
@@ -18,7 +29,7 @@ $NetBSD: patch-ak,v 1.1 2006/01/08 11:02:10 wiz Exp $
if(NO_CHKSUM == 0)
{
-@@ -75,32 +77,74 @@ int unwrap_packet (unsigned char *sp, st
+@@ -75,32 +78,74 @@ int unwrap_packet (unsigned char *sp, st
/* restore orig buffer */
/* general programming rule */
}
diff --git a/net/sniffit/patches/patch-sn__cfgfile_c b/net/sniffit/patches/patch-sn__cfgfile_c
new file mode 100644
index 00000000000..bf786823448
--- /dev/null
+++ b/net/sniffit/patches/patch-sn__cfgfile_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-sn__cfgfile_c,v 1.1 2012/03/31 08:31:06 dholland Exp $
+
+- Use standard headers.
+
+--- sn_cfgfile.c~ 1997-04-18 09:33:58.000000000 +0000
++++ sn_cfgfile.c
+@@ -3,6 +3,8 @@
+
+ #include "sn_config.h"
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "sn_defines.h"
+ #include "sn_structs.h"
+ #include "sn_cfgfile.h"
diff --git a/net/sniffit/patches/patch-sn__cfgfile_h b/net/sniffit/patches/patch-sn__cfgfile_h
new file mode 100644
index 00000000000..1d4bd6f1b32
--- /dev/null
+++ b/net/sniffit/patches/patch-sn__cfgfile_h
@@ -0,0 +1,14 @@
+$NetBSD: patch-sn__cfgfile_h,v 1.1 2012/03/31 08:31:06 dholland Exp $
+
+- declare strlower where it can be seen when used as well as when defined
+
+--- sn_cfgfile.h~ 1997-04-18 09:33:58.000000000 +0000
++++ sn_cfgfile.h
+@@ -1,5 +1,7 @@
+ /* Sniffit Config File include */
+
++char *strlower (char *);
++
+ void clear_list_buffer (struct cfg_file_contense *);
+ struct cfg_file_contense *adjust_select_from_list (void);
+ struct cfg_file_contense *adjust_select_to_list (void);
diff --git a/net/sniffit/patches/patch-sn__logfile_c b/net/sniffit/patches/patch-sn__logfile_c
new file mode 100644
index 00000000000..1bc554d42dd
--- /dev/null
+++ b/net/sniffit/patches/patch-sn__logfile_c
@@ -0,0 +1,25 @@
+$NetBSD: patch-sn__logfile_c,v 1.1 2012/03/31 08:31:06 dholland Exp $
+
+- Use standard headers.
+- Call fchmod correctly.
+
+--- sn_logfile.c.orig 1997-04-18 09:33:58.000000000 +0000
++++ sn_logfile.c
+@@ -4,6 +4,8 @@
+ #include "sn_config.h"
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include "sn_defines.h"
+@@ -81,7 +83,7 @@ LogFILE=fopen(Logfile,"a");
+ if(LogFILE==NULL)
+ printf("Sniffit hardattack.. couldn't create/open logfile...\n"), exit(1);
+ exit_func(logfile_exit);
+-fchmod(LogFILE, S_IWUSR|S_IRUSR);
++fchmod(fileno(LogFILE), S_IWUSR|S_IRUSR);
+ print_logline("Sniffit session started.");
+ printf("Sniffit Logging started. (loglevel: %d)\n",LOGLEVEL);
+ }
diff --git a/net/sniffit/patches/patch-sniffit_h b/net/sniffit/patches/patch-sniffit_h
new file mode 100644
index 00000000000..6101f034c10
--- /dev/null
+++ b/net/sniffit/patches/patch-sniffit_h
@@ -0,0 +1,25 @@
+$NetBSD: patch-sniffit_h,v 1.1 2012/03/31 08:31:06 dholland Exp $
+
+- move strlower to sn_cfgfile.h to make it visible in the right places
+- my_exit should be file-static
+- update const to match changes to sniffit.0.3.5.c
+
+--- sniffit.h~ 1997-04-18 09:33:58.000000000 +0000
++++ sniffit.h
+@@ -15,14 +15,12 @@ void print_iphead (struct IP_header *, c
+ unsigned long getaddrbyname(char *);
+ void quit (char *);
+ void reset_all (void);
+-char *strlower (char *);
+ struct file_info *add_dynam (char *, char, char, unsigned long, int);
+ void delete_dynam (char *, char, char);
+-void record_buf(struct file_info *, unsigned long, char *, int, int);
++void record_buf(struct file_info *, unsigned long, const char *, int, int);
+ void sb_shift(struct file_info *);
+-void sbuf_update(struct file_info *, unsigned long, char *, int);
++void sbuf_update(struct file_info *, unsigned long, const char *, int);
+ struct file_info *search_dynam(char *, char);
+-void my_exit (void);
+
+ /**** Sniffit functions (plugins) *******************************************/
+ void start_plugin (int, struct Plugin_data *);