All,

I've been using the ISC DHCP server for a couple of years now, and I think
it's a wonderful piece of software (thanks Ted).  I've been on an SGI, for
which there is no direct configuration support.

Somewhere along the line, someone posted some patches to get this working
for IRIX, against 1.0.0.  Up until Saturday, I was running 1.0.0, since I
couldn't get the 2.0 series to (a) build completely using raw send and
socket receive (which I was using for 1.0.0) or (b) work with all those
[stupid] MS clients with socket send and receive.

I spent a little time, put the patches back in, and added a couple other
things, and it works wonderfully under IRIX 6.5 (probably for other
versions, too).

After upgrading, I found a few RAS hosts trying to get addresses.  From
paying attention to this list, I knew what to do about it (turn them off).
I found a *lot* of misconfigured NT machines, so this was a good
thing(tm).

Anyway, I'm sending in my patches against 2.0b1pl18 for IRIX.  Feel free
to tweak them up a bit. I've got over 400 fixed hosts split among 6
subnets, and 65 dynamic hosts.  I've been trying to get this deployed at
the entire organization, but people here are really gung-ho on the new
DHCP stuff under NetWare 5 (it uses NDS).  They're scared of Unix
solutions.  I can still use it, just on a much smaller scale than I'd like
to.

Keep up the good work.

-- 
Don Badrak <[EMAIL PROTECTED]>              301.457.8263 work
Telecommunications Office                    301.457.4438 fax
U.S. Bureau of the Census
Suitland MD, USA
diff -Nuar dhcp-2.0b1pl18/Makefile.conf dhcp-2.0b1pl18.irix/Makefile.conf
--- dhcp-2.0b1pl18/Makefile.conf        Sat Feb 27 16:41:10 1999
+++ dhcp-2.0b1pl18.irix/Makefile.conf   Tue Mar 16 17:43:30 1999
@@ -281,3 +281,25 @@
 #RANLIB=/usr/local/i386-unknown-cygwin32/bin/ranlib
 #STRIP=/usr/local/i386-unknown-cygwin32/bin/strip
 ##--cygwin32--
+
+##---
+## IRIX 6.x
+##---
+##--irix--
+#LIBS = -lbind
+#LFLAGS=$(DEBUG) -L/usr/local/lib -Wl,-woff,84 -Wl,-woff,85 -Wl,-woff,134
+#CC=gcc
+#COPTS = -I/usr/local/include -DUSE_RAW_SOCKETS
+#CF = cf/irix.h
+#BINDIR = /usr/local/etc
+#ADMMANDIR = /usr/local/man/man8
+#ADMMANEXT = .8
+#FFMANDIR = /usr/local/man/man5
+#FFMANEXT = .5
+#INSTALL = install
+#MANINSTALL = install
+#CHMOD = chmod
+#CATMANPAGES = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+#ETC = /etc
+#VARRUN = /etc
+#VARDB = /usr/local/etc/dhcp
diff -Nuar dhcp-2.0b1pl18/common/raw.c dhcp-2.0b1pl18.irix/common/raw.c
--- dhcp-2.0b1pl18/common/raw.c Tue Feb 23 17:09:54 1999
+++ dhcp-2.0b1pl18.irix/common/raw.c    Tue Mar 16 17:43:32 1999
@@ -77,10 +77,12 @@
        name.sin_addr.s_addr = htonl (INADDR_BROADCAST);
        memset (name.sin_zero, 0, sizeof (name.sin_zero));
 
+#if 0
        /* List addresses on which we're listening. */
         if (!quiet_interface_discovery)
                note ("Sending on %s, port %d",
                      piaddr (info -> address), htons (local_port));
+#endif
        if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
                error ("Can't create dhcp socket: %m");
 
@@ -104,7 +106,7 @@
                       info -> shared_network -> name : ""));
 }
 
-size_t send_packet (interface, packet, raw, len, from, to, hto)
+ssize_t send_packet (interface, packet, raw, len, from, to, hto)
        struct interface_info *interface;
        struct packet *packet;
        struct dhcp_packet *raw;
@@ -117,6 +119,10 @@
        int bufp = 0;
        struct iovec iov [2];
        int result;
+#if defined(IRIX) || defined(__sgi)
+        int r=ENOMEM;
+        char *temp;
+#endif /* defined(IRIX) || defined(__sgi) */
 
        /* Assemble the headers... */
        assemble_udp_ip_header (interface, buf, &bufp, from.s_addr,
@@ -129,9 +135,29 @@
        iov [1].iov_base = (char *)raw;
        iov [1].iov_len = len;
 
+#if defined(IRIX) || defined(__sgi)
        result = writev(interface -> wfdesc, iov, 2);
        if (result < 0)
                warn ("send_packet: %m");
        return result;
+#else
+        temp=malloc(bufp*len);
+        if (temp)
+        {
+           memcpy(temp, buf, bufp);
+           memcpy(&(temp[bufp]), raw, len);
+           r=sendto(interface -> wfdesc, temp, len+bufp, 0,
+                   to, sizeof (*to));
+           free(temp);
+        }
+        return r;
+#endif /* defined(IRIX) || defined(__sgi) */
 }
-#endif /* USE_SOCKET_SEND */
+
+int can_unicast_without_arp () { return 1; }
+
+void maybe_setup_fallback () { }
+
+void if_reinitialize_send (struct interface_info *info) { }
+
+#endif /* USE_RAW_SEND */
diff -Nuar dhcp-2.0b1pl18/configure dhcp-2.0b1pl18.irix/configure
--- dhcp-2.0b1pl18/configure    Wed Feb  3 13:53:36 1999
+++ dhcp-2.0b1pl18.irix/configure       Tue Mar 16 17:43:33 1999
@@ -47,6 +47,8 @@
       sysname=qnx;;
     NEXTSTEP)
       sysname=nextstep;;
+    IRIX*)
+      sysname=irix;;
   esac
 fi
 
@@ -70,6 +72,7 @@
   echo "   hpux                HP-UX"
   echo "   qnx         QNX 4.2 or higher"
   echo "   NEXTSTEP     NeXTSTEP"
+  echo "   irix         IRIX 6.x"
   exit 1;
 fi
 
diff -Nuar dhcp-2.0b1pl18/includes/cf/irix.h dhcp-2.0b1pl18.irix/includes/cf/irix.h
--- dhcp-2.0b1pl18/includes/cf/irix.h   Wed Dec 31 19:00:00 1969
+++ dhcp-2.0b1pl18.irix/includes/cf/irix.h      Tue Mar 16 17:43:31 1999
@@ -0,0 +1,96 @@
+/* irix.h */
+/*
+ * Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of The Internet Software Consortium nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#define int8_t         char
+#define int16_t                short
+#define int32_t                long
+
+#define u_int8_t       unsigned char
+#define u_int16_t      unsigned short 
+#define u_int32_t      unsigned long 
+
+#include <sys/types.h>
+
+#include <syslog.h>
+
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <setjmp.h>
+#include <limits.h>
+#include <net/if_dl.h>
+
+extern int h_errno;
+
+#include <net/if.h>
+#include <net/if_arp.h>
+
+#define _PATH_DHCPD_CONF "/usr/local/etc/dhcpd.conf"
+#define _PATH_DHCPD_DB   "/usr/local/etc/dhcp/dhcpd.leases"
+
+#ifndef _PATH_DHCPD_PID
+#define _PATH_DHCPD_PID        "/etc/dhcpd.pid"
+#endif
+#ifndef _PATH_DHCLIENT_PID
+#define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
+#endif
+#ifndef _PATH_DHCRELAY_PID
+#define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
+#endif
+
+#include <stdarg.h>
+#define VA_DOTDOTDOT ...
+#define VA_start(list, last) va_start (list, last)
+#define va_dcl
+
+#define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list)
+#define NO_SNPRINTF
+
+#ifndef USE_RAW_SOCKETS
+#define USE_RAW_SOCKETS        1
+#endif
+#if 0
+#define USE_SOCKETS    1
+#endif
+#define EOL '\n'
+#define VOIDPTR void *
+
+#include <time.h>
+
+#define TIME time_t
+#define GET_TIME(x)    time ((x))
+
+#define random rand
+
+#define DHCPD_LOG_FACILITY LOG_LOCAL2
diff -Nuar dhcp-2.0b1pl18/includes/osdep.h dhcp-2.0b1pl18.irix/includes/osdep.h
--- dhcp-2.0b1pl18/includes/osdep.h     Sat Feb 27 16:42:25 1999
+++ dhcp-2.0b1pl18.irix/includes/osdep.h        Tue Mar 16 17:43:32 1999
@@ -123,6 +123,10 @@
 # endif
 #endif
 
+#if defined(IRIX) || defined(__sgi)
+#  include "cf/irix.h"
+#endif
+
 #if !defined (TIME_MAX)
 # define TIME_MAX 2147483647
 #endif
@@ -262,4 +266,3 @@
 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
 # define HAVE_AF_LINK
 #endif
-

Reply via email to