pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/wminet Attempt at DragonFly support.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6016facfbe18
branches:  trunk
changeset: 510071:6016facfbe18
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Mar 23 17:31:05 2006 +0000

description:
Attempt at DragonFly support.

diffstat:

 net/wminet/distinfo         |   4 +-
 net/wminet/patches/patch-ab |  47 +++++++++++++++++++++++++++-----------------
 2 files changed, 31 insertions(+), 20 deletions(-)

diffs (139 lines):

diff -r 8a3554778375 -r 6016facfbe18 net/wminet/distinfo
--- a/net/wminet/distinfo       Thu Mar 23 17:20:22 2006 +0000
+++ b/net/wminet/distinfo       Thu Mar 23 17:31:05 2006 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.4 2005/02/24 12:14:07 agc Exp $
+$NetBSD: distinfo,v 1.5 2006/03/23 17:31:05 joerg Exp $
 
 SHA1 (wmnet-1.2.tar.gz) = 9d7cad6d1ba90d2141665da155c880fae9f70614
 RMD160 (wmnet-1.2.tar.gz) = 73e9b98487e43669e76651b7134f45c1af689e4a
 Size (wmnet-1.2.tar.gz) = 19647 bytes
 SHA1 (patch-aa) = d879f82d87ea42ae97726cddbfc5c9ec5ff4acd3
-SHA1 (patch-ab) = c0a69670629837745da3f93c038bad2b94a1c54f
+SHA1 (patch-ab) = 5b0cf1f48d7f21a29445519cfa6169bcf28933f8
diff -r 8a3554778375 -r 6016facfbe18 net/wminet/patches/patch-ab
--- a/net/wminet/patches/patch-ab       Thu Mar 23 17:20:22 2006 +0000
+++ b/net/wminet/patches/patch-ab       Thu Mar 23 17:31:05 2006 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.1.1.1 2001/02/28 15:37:25 hubertf Exp $
+$NetBSD: patch-ab,v 1.2 2006/03/23 17:31:06 joerg Exp $
 
---- if.c.orig  Mon Oct 12 04:13:16 1998
-+++ if.c       Sat Feb 24 19:48:53 2001
-@@ -12,6 +12,7 @@
+--- if.c.orig  1998-10-12 02:13:16.000000000 +0000
++++ if.c
+@@ -12,12 +12,13 @@
  #include <unistd.h>
  #include <limits.h>
  #include <err.h>
@@ -10,11 +10,18 @@
  #include <sys/param.h>
  #include <sys/types.h>
  #include <sys/ioctl.h>
-@@ -89,7 +90,11 @@
+ #include <sys/socket.h>
+ #include <net/if.h>
+-#if (__FreeBSD_version >= 300003)
++#if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300003)
+ #include <net/if_var.h>
+ #include <net/if_types.h>
+ #endif
+@@ -89,7 +90,11 @@ static int addIfData(unsigned long theAd
                        if (!newData) {
                                size -= IF_STEP;
                                fprintf(stderr, "wmnet: Warning -- low memory; "
-+#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
 +                                              "ignoring %s interface\n", theData->if_xname);
 +#else
                                                "ignoring %s interface\n", theData->if_name);
@@ -22,11 +29,11 @@
                                return 0;
                        }
  
-@@ -118,8 +123,12 @@
+@@ -118,8 +123,12 @@ static int addIfData(unsigned long theAd
                ptr->flags = 0;
  
  #ifndef NDEBUG
-+#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
 +              printf("Added '%.*s' to list.\n", IFNAMSIZ, theData->if_xname);
 +#else
                printf("Added '%.*s%d' to list.\n", IFNAMSIZ, theData->if_name,
@@ -35,15 +42,15 @@
  #endif
  
                // Bump the total.
-@@ -161,6 +170,7 @@
+@@ -161,6 +170,7 @@ static struct ifnet const* dereference(u
                return &d;
        else if (sizeof(d) == kvm_read(kd, a, &d, sizeof(d))) {
  
-+#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__DragonFly__)
                /* We've read the structure's data, but the 'name' field still
                   points to kernel memory. We transfer the name to a local
                   buffer, and then modify the pointer to point to our
-@@ -178,6 +188,7 @@
+@@ -178,22 +188,32 @@ static struct ifnet const* dereference(u
                           to look at. While debugging, set these to NULL to trap
                           any attempts. */
  
@@ -51,7 +58,7 @@
                        d.if_softc = 0;
  #if (__FreeBSD_version >= 300003)
                        d.if_addrhead.tqh_first = 0;
-@@ -185,15 +196,24 @@
+ #else
                        d.if_addrlist = 0;
  #endif
                        d.if_bpf = 0;
@@ -64,7 +71,7 @@
  #endif
                        c = a;
                        return &d;
-+#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__DragonFly__)
                } else
                        return 0;
 +#endif /* !NetBSD */
@@ -76,7 +83,7 @@
  }
  
  /*------------------------------------------------------------------------------
-@@ -233,6 +253,9 @@
+@@ -233,6 +253,9 @@ int ifInit(void)
                        { "" }
                };
  
@@ -86,8 +93,12 @@
                /* Try to pull the address for the global kernel variable,
                   ifnet. This variable is the root of the singly-linked list
                   of network interfaces. */
-@@ -251,8 +274,12 @@
- #if (__FreeBSD_version >= 300003)
+@@ -248,11 +271,15 @@ int ifInit(void)
+ 
+                               while (current) {
+                                       addIfData(current);
+-#if (__FreeBSD_version >= 300003)
++#if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300003)
                                        current = (unsigned long) dereference(current)->if_link.tqe_next;
  #else
 +#ifdef __NetBSD__
@@ -99,11 +110,11 @@
                                }
  
                                /* Try to register our termination function. If it
-@@ -309,7 +336,11 @@
+@@ -309,7 +336,11 @@ char const* ifName(unsigned idx)
                if (ptr) {
                        static char buffer[IFNAMSIZ + 1];
  
-+#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
 +                      sprintf(buffer, "%.*s", IFNAMSIZ - 1, ptr->if_xname);
 +#else
                        sprintf(buffer, "%.*s%d", IFNAMSIZ - 1, ptr->if_name, ptr->if_unit);



Home | Main Index | Thread Index | Old Index