]> arthur.barton.de Git - netatalk.git/commitdiff
Joe Clarke's patches and some other fixes
authorrufustfirefly <rufustfirefly>
Tue, 19 Jun 2001 18:04:39 +0000 (18:04 +0000)
committerrufustfirefly <rufustfirefly>
Tue, 19 Jun 2001 18:04:39 +0000 (18:04 +0000)
ChangeLog
configure.in
etc/afpd/file.c
etc/afpd/parse_mtab.c
etc/afpd/parse_mtab.h
etc/atalkd/route.h
etc/atalkd/rtmp.c
etc/papd/headers.c
etc/papd/magics.c
libatalk/asp/asp_tickle.c

index 8f3925e6ccbba90510cdf9e2acea3c97815267f4..b9fbe8174418d4c6077989e90485c4cfe14e4095 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
-($Id: ChangeLog,v 1.48 2001-06-18 13:50:06 rufustfirefly Exp $)
+($Id: ChangeLog,v 1.49 2001-06-19 18:04:39 rufustfirefly Exp $)
+
+2001-06-19  jeff b  <jeff@univrel.pr.uconn.edu>
+       * etc/afpd/file.c, etc/afpd/parse_mtab.c, etc/afpd/parse_mtab.h,
+       etc/atalkd/route.h, etc/atalkd/rtmp.c, etc/papd/headers.c,
+       etc/papd/magics.c, libatalk/asp/asp_tickle.c: patch for
+       fixed DID calculation in etc/afpd/file.c, FreeBSD errors and
+       other miscellany (Joe Clarke) 
+
+       * minor patches and fixes to the aforementioned files, warning
+       fixes with GCC, etc (Jeff)
 
 2001-06-18  jeff b  <jeff@univrel.pr.uconn.edu>
        * configure.in, etc/uams/Makefile.am,
index 97e81ecec6fba67ebb0ff83b1120c51e468beec9..bb8f5acb59b2b62ea2283e9f1f95f37cca8d26d1 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.89 2001-06-19 17:03:26 srittau Exp $
+dnl $Id: configure.in,v 1.90 2001-06-19 18:04:39 rufustfirefly Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -85,7 +85,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h)
+AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h)
 AC_CHECK_HEADER(sys/cdefs.h,,
        AC_MSG_RESULT([enabling generic cdefs.h from tree])
        CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
@@ -264,17 +264,18 @@ AC_CHECK_LIB(pam, pam_start,
        LIBS="$LIBS -lpam"
        compile_pam=yes
 )
-AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
 
 AC_ARG_WITH(pam,
-       [  --with-pam              enable password authentication modules support],
-       if test "x$compile_pam" = "xyes"; then
-               use_pam_so=yes
-               AC_MSG_RESULT([enabling pam modules support])
-       else
-               AC_MSG_RESULT([pam libraries not found. Disabling pam modules support])
-       fi
+       [  --without-pam           disable password authentication modules support],
+       compile_pam=no
+       use_pam_so=no
+       AC_DEFINE(USE_PAM, 0)
+       AC_MSG_RESULT([Disabling pam modules support])
 )
+if test "x$compile_pam" = "xyes"; then
+       use_pam_so=yes
+       AC_MSG_RESULT([Enabling pam modules support])
+fi
 
 shadowpw=no
 AC_ARG_WITH(shadow,
@@ -428,6 +429,7 @@ if test x"$this_os" = "xfreebsd"; then
 
        dnl ----- Set -shared flag
        LDSHAREDFLAGS="-shared"
+       AC_DEFINE(NO_CRYPT_H, 1)
 fi
 
 dnl ----- HP-UX 11 specific -----
@@ -636,6 +638,7 @@ AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
+AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
index 0868cc6d1331735981aaee3c34726afdee007084..0ad5cf8a568a0228a8be60b464d4fef268e714b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.20 2001-05-31 18:48:32 srittau Exp $
+ * $Id: file.c,v 1.21 2001-06-19 18:04:39 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -7,7 +7,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include "filedir.h"
 #include "globals.h"
 
+/* check for mtab DID code */
+#ifdef DID_MTAB
+#include "parse_mtab.h"
+#endif /* DID_MTAB */
+
 #ifdef FORCE_UIDGID
 #include "uid.h"
 #endif /* FORCE_UIDGID */
@@ -78,7 +83,11 @@ int getfilparams(vol, bitmap, path, dir, st, buf, buflen )
     char       *buf;
     int                *buflen;
 {
+#ifndef USE_LASTDID
     struct stat                hst, lst, *lstp;
+#else /* USE_LASTDID */
+    struct stat                hst;
+#endif /* USE_LASTDID */
     struct adouble     ad, *adp;
     struct ofork        *of;
     struct extmap      *em;
@@ -89,7 +98,7 @@ int getfilparams(vol, bitmap, path, dir, st, buf, buflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin getfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     upath = mtoupath(vol, path);
     if ((of = of_findname(vol, curdir, path))) {
@@ -196,7 +205,7 @@ int getfilparams(vol, bitmap, path, dir, st, buf, buflen )
 
            if (!(aint = cnid_add(vol->v_db, st, dir->d_did, upath, 
                                  strlen(upath), aint))) {
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
            /*
             * What a fucking mess.  First thing:  DID and FNUMs are
             * in the same space for purposes of enumerate (and several
@@ -223,11 +232,20 @@ int getfilparams(vol, bitmap, path, dir, st, buf, buflen )
             *
             * it should be okay to use lstat to deal with symlinks.
             */
-             lstp = (lstat(upath, &lst) < 0) ? st : &lst;
+#ifdef USE_LASTDID
+             aint = htonl(( st->st_dev << 16 ) | (st->st_ino & 0x0000ffff));
+#else /* USE_LASTDID */
+             lstp = lstat(upath, &lst) < 0 ? st : &lst;
+#ifdef DID_MTAB
+             aint = htonl( afpd_st_cnid ( lstp ) );
+#else /* DID_MTAB */
              aint = htonl(CNID(lstp, 1));
+#endif /* DID_MTAB */
+#endif /* USE_LASTDID */
+
 #if AD_VERSION > AD_VERSION1
            }
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
            memcpy(data, &aint, sizeof( aint ));
            data += sizeof( aint );
            break;
@@ -321,7 +339,7 @@ int getfilparams(vol, bitmap, path, dir, st, buf, buflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end getfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return( AFP_OK );
 }
@@ -341,11 +359,11 @@ int afp_createfile(obj, ibuf, ibuflen, rbuf, rbuflen )
     u_int16_t          vid;
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_createfile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     *rbuflen = 0;
     ibuf++;
@@ -407,7 +425,7 @@ int afp_createfile(obj, ibuf, ibuflen, rbuf, rbuflen )
        /* perform all switching of users */
        set_uidgid ( vol );
 
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     if ( ad_open( upath, vol_noadouble(vol)|ADFLAGS_DF|ADFLAGS_HF,
                  openf, 0666, adp) < 0 ) {
@@ -416,13 +434,13 @@ int afp_createfile(obj, ibuf, ibuflen, rbuf, rbuflen )
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_EXIST );
        case EACCES :
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_ACCESS );
         case ENOENT:
            /* on noadouble volumes, just creating the data fork is ok */
@@ -433,7 +451,7 @@ int afp_createfile(obj, ibuf, ibuflen, rbuf, rbuflen )
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
                restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
            return( AFPERR_PARAM );
        }
     }
@@ -448,20 +466,20 @@ createfile_done:
 
 #ifdef DROPKLUDGE
     if (vol->v_flags & AFPVOL_DROPBOX) {
-         retvalue=matchfile2dirperms(upath, vol, did);
+         retvalue = matchfile2dirperms(upath, vol, did);
     }
-#endif DROPKLUDGE
+#endif /* DROPKLUDGE */
 
     setvoltime(obj, vol );
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end afp_createfile");
-#endif DEBUG
+#endif /* DEBUG */
 
 #ifdef FORCE_UIDGID
        /* bring everything back to old euid, egid */
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     return (retvalue);
 }
@@ -479,7 +497,7 @@ int afp_setfilparams(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_setfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     *rbuflen = 0;
     ibuf += 2;
@@ -517,7 +535,7 @@ int afp_setfilparams(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end afp_setfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return( rc );
 }
@@ -540,11 +558,11 @@ int setfilparams(vol, path, bitmap, buf )
 
 #ifdef FORCE_UIDGID
        uidgidset               *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin setfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     upath = mtoupath(vol, path);
     if ((of = of_findname(vol, curdir, path))) {
@@ -557,7 +575,7 @@ int setfilparams(vol, path, bitmap, buf )
 #ifdef FORCE_UIDGID
        save_uidgid ( uidgid );
        set_uidgid ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     if (ad_open( upath, vol_noadouble(vol) | ADFLAGS_HF, 
                 O_RDWR|O_CREAT, 0666, adp) < 0) {
@@ -565,7 +583,7 @@ int setfilparams(vol, path, bitmap, buf )
       if (bitmap & ~(1<<FILPBIT_MDATE)) {
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
        return vol_noadouble(vol) ? AFP_OK : AFPERR_ACCESS;
       }
       isad = 0;
@@ -686,13 +704,13 @@ setfilparam_done:
 
 #ifdef FORCE_UIDGID
        restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
 
     }
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end setfilparams:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return err;
 }
@@ -722,7 +740,7 @@ int renamefile(src, dst, newname, noadouble )
 
 #ifdef DEBUG
     syslog (LOG_INFO, "begin renamefile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     if ( rename( src, dst ) < 0 ) {
        switch ( errno ) {
@@ -793,7 +811,7 @@ rename_retry:
 
 #ifdef DEBUG
     syslog (LOG_INFO, "end renamefile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return( AFP_OK );
 }
@@ -812,7 +830,7 @@ int afp_copyfile(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog (LOG_INFO, "begin afp_copyfile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     *rbuflen = 0;
     ibuf += 2;
@@ -892,11 +910,11 @@ int afp_copyfile(obj, ibuf, ibuflen, rbuf, rbuflen )
     if (vol->v_flags & AFPVOL_DROPBOX) {
          retvalue=matchfile2dirperms(newname, vol, sdid);
     }
-#endif DROPKLUDGE
+#endif /* DROPKLUDGE */
 
 #ifdef DEBUG
     syslog (LOG_INFO, "end afp_copyfile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return( retvalue );
 }
@@ -909,7 +927,7 @@ static __inline__ int copy_all(const int dfd, const void *buf,
 
 #ifdef DEBUG
   syslog(LOG_INFO, "begin copy_all:");
-#endif DEBUG
+#endif /* DEBUG */
 
   while (buflen > 0) {
     if ((cc = write(dfd, buf, buflen)) < 0) {
@@ -931,7 +949,7 @@ static __inline__ int copy_all(const int dfd, const void *buf,
 
 #ifdef DEBUG
   syslog(LOG_INFO, "end copy_all:");
-#endif DEBUG
+#endif /* DEBUG */
 
   return AFP_OK;
 }
@@ -950,7 +968,7 @@ int copyfile(src, dst, newname, noadouble )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin copyfile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     if (newname) { 
       if ((sfd = open( ad_path( src, ADFLAGS_HF ), O_RDONLY, 0 )) < 0 ) {
@@ -997,7 +1015,7 @@ int copyfile(src, dst, newname, noadouble )
          }
          goto copyheader_done;
        }
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX */
        while (1) {
          if ((cc = read(sfd, filebuf, sizeof(filebuf))) < 0) {
            if (errno == EINTR) 
@@ -1061,7 +1079,7 @@ copyheader_done:
       }
       goto copydata_done;
     }
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX */
 
     while (1) {
       if ((cc = read( sfd, filebuf, sizeof( filebuf ))) < 0) {
@@ -1111,7 +1129,7 @@ copydata_done:
     
 #ifdef DEBUG
     syslog(LOG_INFO, "end copyfile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return( AFP_OK );
 }
@@ -1127,7 +1145,7 @@ int deletefile( file )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin deletefile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     while(1) {
        /*
@@ -1233,7 +1251,7 @@ delete_unlock:
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end deletefile:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return err;
 }
@@ -1257,7 +1275,7 @@ int afp_createid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_createid:");
-#endif DEBUG
+#endif /* DEBUG */
     
     *rbuflen = 0;
     ibuf += 2;
@@ -1322,7 +1340,7 @@ int afp_createid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "ending afp_createid...:");
-#endif DEBUG
+#endif /* DEBUG */
 
     switch (errno) {
     case EROFS:
@@ -1354,7 +1372,7 @@ int afp_resolveid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_resolveid:");
-#endif DEBUG
+#endif /* DEBUG */
     
     *rbuflen = 0;
     ibuf += 2;
@@ -1405,7 +1423,7 @@ int afp_resolveid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end afp_resolveid:");
-#endif DEBUG
+#endif /* DEBUG */
     
     return AFP_OK;
 }
@@ -1425,7 +1443,7 @@ int afp_deleteid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_deleteid:");
-#endif DEBUG
+#endif /* DEBUG */
 
     *rbuflen = 0;
     ibuf += 2;
@@ -1484,13 +1502,14 @@ int afp_deleteid(obj, ibuf, ibuflen, rbuf, rbuflen )
 
 #ifdef DEBUG
     syslog(LOG_INFO, "end afp_deleteid:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return err;
 }
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #define APPLETEMP ".AppleTempXXXXXX"
+
 int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen )
     AFPObj      *obj;
     char       *ibuf, *rbuf;
@@ -1504,13 +1523,13 @@ int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen )
     int                 err;
 #if AD_VERSION > AD_VERSION1
     int                 slen, dlen;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
     cnid_t             sid, did;
     u_int16_t          vid;
 
 #ifdef DEBUG
     syslog(LOG_INFO, "begin afp_exchangefiles:");
-#endif DEBUG
+#endif /* DEBUG */
 
     *rbuflen = 0;
     ibuf += 2;
@@ -1570,7 +1589,7 @@ int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen )
 #if AD_VERSION > AD_VERSION1
     sid = cnid_lookup(vol->v_db, &srcst, sdir->d_did, supath, 
                      slen = strlen(supath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
     if (( dir = dirsearch( vol, did )) == NULL ) {
        return( AFPERR_PARAM );
@@ -1606,7 +1625,7 @@ int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen )
     /* look for destination id. */
     did = cnid_lookup(vol->v_db, &destst, curdir->d_did, upath, 
                      dlen = strlen(upath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
     /* construct a temp name. 
      * NOTE: the temp file will be in the dest file's directory. it
@@ -1658,11 +1677,11 @@ int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen )
        cnid_update(vol->v_db, sid, &srcst, sdir->d_did, supath, slen);
       goto err_temp_to_dest;
     }
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
 
 #ifdef DEBUG
     syslog(LOG_INFO, "ending afp_exchangefiles:");
-#endif DEBUG
+#endif /* DEBUG */
 
     return AFP_OK;
 
index 4cc28aee959c5ae52b8038f2de44d86df9fc7fd8..462107fe1ef3a498462f7c589753550bbda63372 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.c,v 1.2 2001-06-10 20:15:00 srittau Exp $
+ * $Id: parse_mtab.c,v 1.3 2001-06-19 18:04:39 rufustfirefly Exp $
  *
  * afpd_mtab_parse & support.  -- rgr, 9-Apr-01.
  */
@@ -25,9 +25,6 @@
          (lval) = malloc(1+strlen(str)), strcpy((lval), (str))
 #endif /* COPY_STRING */
 
-/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
-static struct afpd_mount_table *afpd_mount_table = NULL;
-
 static int
 ceil_log_2 __P((int n))
      /* Return the number of bits required to represent n.  Only works for
index 9e9e34bd8119c78770e009447b567339aa83ed7b..b410251b966387e6fdcf9686791df073ce11a3b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.h,v 1.2 2001-06-06 13:36:36 rufustfirefly Exp $
+ * $Id: parse_mtab.h,v 1.3 2001-06-19 18:04:39 rufustfirefly Exp $
  *
  * header for afpd_mtab_parse, afpd_st_cnid
  */
@@ -31,6 +31,9 @@ struct afpd_mount_table {
                                           entries may be null */
 };
 
+/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
+static struct afpd_mount_table *afpd_mount_table = NULL;
+
 extern
 unsigned int
 afpd_st_cnid __P((struct stat *st));
index 989c52a32d66171f2538c21da7e0fb1ab5515b4c..15698c48e4041da43beb4492603339b0466c12c5 100644 (file)
@@ -1,8 +1,16 @@
+/*
+ * $Id: route.h,v 1.2 2001-06-19 18:04:39 rufustfirefly Exp $
+ */
+
 #ifndef ATALKD_ROUTE_H
 #define ATALKD_ROUTE_H 1
 
 #include <sys/cdefs.h>
 
+#ifndef BSD4_4
 int route __P(( int, struct sockaddr *, struct sockaddr *, int ));
+#else /* BSD4_4 */
+int route __P(( int, struct sockaddr_at *, struct sockaddr_at *, int));
+#endif /* BSD4_4 */
 
 #endif /* ATALKD_ROUTE_H */
index c167e384e87892f47590f8be3e097c22e936f888..3819f5691f84c253b529bb7b5a32de0823ff8117 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: rtmp.c,v 1.5 2001-06-19 18:04:39 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <string.h>
@@ -21,7 +23,7 @@
 
 #ifdef __svr4__
 #include <sys/sockio.h>
-#endif __svr4__
+#endif /* __svr4__ */
 
 #include <atalk/ddp.h>
 #include <atalk/atp.h>
@@ -539,10 +541,10 @@ int rtmp_packet( ap, from, data, len )
                return 1;
            }
             */
-#else PHASE1NET
+#else /* PHASE1NET */
            syslog( LOG_INFO, "rtmp_packet bad first tuple" );
            return 1;
-#endif PHASE1NET
+#endif /* PHASE1NET */
        }
 
        /*
@@ -789,7 +791,7 @@ int rtmp_packet( ap, from, data, len )
            printf( "rtmp_packet rdr (%d) from %u.%u\n",
                    *data, ntohs( from->sat_addr.s_net ),
                    from->sat_addr.s_node );
-#endif DEBUG
+#endif /* DEBUG */
        } else {
            syslog( LOG_INFO, "rtmp_packet unknown request from %u.%u\n",
                    ntohs( from->sat_addr.s_net ), from->sat_addr.s_node );
@@ -834,7 +836,7 @@ int rtmp_request( iface )
     memset( &sat, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     sat.sat_family = AF_APPLETALK;
     sat.sat_addr.s_net = iface->i_addr.sat_addr.s_net;
     sat.sat_addr.s_node = ATADDR_BCAST;
@@ -867,24 +869,33 @@ int looproute( iface, cmd )
     memset( &dst, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     dst.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     dst.sat_family = AF_APPLETALK;
     dst.sat_addr.s_net = iface->i_addr.sat_addr.s_net;
     dst.sat_addr.s_node = iface->i_addr.sat_addr.s_node;
     memset( &loop, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     loop.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     loop.sat_family = AF_APPLETALK;
     loop.sat_addr.s_net = htons( ATADDR_ANYNET );
     loop.sat_addr.s_node = ATADDR_ANYNODE;
 
+#ifndef BSD4_4
     if ( route( cmd,
                (struct sockaddr *) &dst,
                (struct sockaddr *) &loop,
                RTF_UP | RTF_HOST ) ) {
        return( 1 );
     }
+#else /* BSD4_4 */
+    if ( route( cmd,
+               (struct sockaddr_at *) &dst,
+               (struct sockaddr_at *) &loop,
+               RTF_UP | RTF_HOST ) ) {
+       return ( 1);
+    }
+#endif /* BSD4_4 */
     if ( cmd == RTMP_ADD ) {
        iface->i_flags |= IFACE_LOOP;
     }
@@ -918,7 +929,7 @@ int gateroute( command, rtmp )
     memset( &gate, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     gate.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     gate.sat_family = AF_APPLETALK;
     gate.sat_addr.s_net = rtmp->rt_gate->g_sat.sat_addr.s_net;
     gate.sat_addr.s_node = rtmp->rt_gate->g_sat.sat_addr.s_node;
@@ -929,12 +940,13 @@ int gateroute( command, rtmp )
     memset( &dst, 0, sizeof( struct sockaddr_at ));
 #ifdef BSD4_4
     dst.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
     dst.sat_family = AF_APPLETALK;
     dst.sat_addr.s_node = ATADDR_ANYNODE;
 
     do {
        dst.sat_addr.s_net = htons( net );
+#ifndef BSD4_4
        if ( route( command,
                    (struct sockaddr *) &dst,
                    (struct sockaddr *) &gate,
@@ -943,6 +955,16 @@ int gateroute( command, rtmp )
                    ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
            continue;
        }
+#else /* BSD4_4 */
+       if ( route( command,
+                   (struct sockaddr_at *) &dst,
+                   (struct sockaddr_at *) &gate,
+                   RTF_UP | RTF_GATEWAY )) {
+           syslog( LOG_ERR, "route: %u -> %u.%u: %m", net,
+                   ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
+           continue;
+       }
+#endif /* BSD4_4 */
     } while ( net++ < ntohs( rtmp->rt_lastnet ));
 
     if ( command == RTMP_ADD ) {
index 1b436613fc43c081ef2eada085d649fdf1233257..dfeea498f48d7e3b4a1abb88dcb3133f12a76d8f 100644 (file)
@@ -1,16 +1,20 @@
 /*
+ * $Id: headers.c,v 1.7 2001-06-19 18:04:40 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h" 
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/syslog.h>
 #include <sys/param.h>
 #include <stdio.h>
 
+#include <netatalk/at.h>
+
 #include "file.h"
 #include "comment.h"
 #include "lp.h"
index 59fac7c291ba8b7994a142990e0d7bbeae0507ec..76fd710dbe485063d970f27c3008677efe097ed3 100644 (file)
@@ -1,11 +1,13 @@
 /*
+ * $Id: magics.c,v 1.7 2001-06-19 18:04:40 rufustfirefly Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <sys/syslog.h>
 #include <sys/param.h>
@@ -13,6 +15,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include <netatalk/at.h>
+
 #include "file.h"
 #include "comment.h"
 #include "lp.h"
index f38d211c86497c103b58bda5c206dae6143eb56a..758e000997de3c4642b1d33a19abd8a52395e5c5 100644 (file)
@@ -1,10 +1,17 @@
+/*
+ * $Id: asp_tickle.c,v 1.4 2001-06-19 18:04:40 rufustfirefly Exp $
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <syslog.h>
-#include <sys/socket.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
 
+#include <sys/socket.h>
 #include <atalk/atp.h>
 #include <atalk/asp.h>