-($Id: ChangeLog,v 1.56 2001-06-27 18:22:19 uhees Exp $)
+($Id: ChangeLog,v 1.57 2001-06-29 14:14:46 rufustfirefly Exp $)
+
+2001-06-27 jeff b <jeff@univrel.pr.uconn.edu>
+ * many, many, files: more malformed ifdef correction, nicer
+ comments, etc, etc, etc
+
+ * etc/afpd/directory.c, etc/afpd/uid.c, etc/afpd/uid.h: fixes
+ for force-uidgid to compile properly. haven't tested it, but
+ no more compile errors. (Jeff)
2001-06-27 uwe hees <hees@viva.de>
* etc/uams/uams_guest.c: fixed a typo.
-2001-06-26 andy m <morgan@orst.edu
+2001-06-26 andy m <morgan@orst.edu>
* etc/papd/file.c: modified markline() to return 1 instead
of *linelength for successful completion. This should fix
the remaining binary printing problems in papd. Thanks go
-/* v1tov2: given a root directory, run down and convert all the
- * files/directories into appledouble v2. */
+/*
+ * $Id: adv1tov2.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * v1tov2: given a root directory, run down and convert all the
+ * files/directories into appledouble v2.
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
return 0;
}
-#else
+#else /* AD_VERSION == AD_VERSION2 */
int main(int argc, char **argv)
{
fprintf(stderr, "%s not built for v2 AppleDouble files.\n", *argv);
return -1;
}
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
/*
+ * $Id: aecho.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <netatalk/endian.h>
#include <netatalk/at.h>
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
struct sockaddr_at target;
int s, nsent = 0, nrecv = 0;
memset( &target, 0, sizeof( struct sockaddr_at ));
#ifdef BSD4_4
target.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
target.sat_family = AF_APPLETALK;
if ( !atalk_aton( av[ optind ], &target.sat_addr )) {
if ( nbp_name( av[ optind ], &obj, &type, &zone ) || !obj ) {
-/* afile - determine the MacOS creator/type of files
+/*
+ * $Id: achfile.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ afile - determine the MacOS creator/type of files
Copyright (C) 2001 Sebastian Rittau.
All rights reserved.
SUCH DAMAGE.
*/
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <atalk/adouble.h>
-/* afile - determine the MacOS creator/type of files
+/*
+ * $Id: afile.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ afile - determine the MacOS creator/type of files
Copyright (C) 2001 Sebastian Rittau.
All rights reserved.
SUCH DAMAGE.
*/
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <atalk/adouble.h>
-/* common functions, defines, and structures for afile, achfile, and acleandir
+/*
+ * $Id: common.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ common functions, defines, and structures for afile, achfile, and acleandir
Copyright (C) 2001 Sebastian Rittau.
All rights reserved.
SUCH DAMAGE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <atalk/adouble.h>
#include <netatalk/endian.h>
-/* common functions, defines, and structures for afile, achfile, and acleandir
+/*
+ * $Id: common.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ common functions, defines, and structures for afile, achfile, and acleandir
Copyright (C) 2001 Sebastian Rittau.
All rights reserved.
/*
+ * $Id: afppasswd.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright 1999 (c) Adrian Sun (asun@u.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <pwd.h>
#include <netatalk/endian.h>
#ifdef USE_CRACKLIB
#include <crack.h>
-#endif
+#endif /* USE_CRACKLIB */
#define OPT_ISROOT (1 << 0)
#define OPT_CREATE (1 << 1)
goto update_done;
}
}
-#endif
+#endif /* USE_CRACKLIB */
passwd = getpass("Enter NEW AFP password again: ");
if (strcmp(passwd, password) == 0) {
fprintf(stderr, " -f force an action\n");
#ifdef USE_CRACKLIB
fprintf(stderr, " -n disable cracklib checking of passwords\n");
-#endif
+#endif /* USE_CRACKLIB */
fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n");
fprintf(stderr, " -p path path to afppasswd file\n");
return -1;
case 'n': /* disable CRACKLIB check */
flags |= OPT_NOCRACK;
break;
-#endif
+#endif /* USE_CRACKLIB */
case 'p': /* path to afppasswd file */
path = optarg;
break;
(flags & OPT_ISROOT)) != argc)) {
#ifdef USE_CRACKLIB
fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
-#else if !(defined(USE_CRACKLIB))
+#else /* USE_CRACKLIB */
fprintf(stderr, "Usage: afppasswd [-acf] [-u minuid] [-p path] [username]\n");
-#endif
+#endif /* USE_CRACKLIB */
fprintf(stderr, " -a add a new user\n");
fprintf(stderr, " -c create and initialize password file or specific user\n");
fprintf(stderr, " -f force an action\n");
#ifdef USE_CRACKLIB
fprintf(stderr, " -n disable cracklib checking of passwords\n");
-#endif
+#endif /* USE_CRACKLIB */
fprintf(stderr, " -u uid minimum uid to use, defaults to 100\n");
fprintf(stderr, " -p path path to afppasswd file\n");
return -1;
return -1;
}
}
-#else
+#else /* UAM_RNDNUM */
main(int argc, char **argv)
{
fprintf(stderr, "for the Random Number authentication methods.\n");
return -1;
}
-#endif
+#endif /* UAM_RNDNUM */
+/*
+ * $Id: getzones.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <stdio.h>
#include <string.h>
#include <netatalk/endian.h>
memset( &saddr, 0, sizeof( struct sockaddr_at ));
#ifdef BSD4_4
saddr.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
saddr.sat_family = AF_APPLETALK;
if (( se = getservbyname( "zip", "ddp" )) == NULL )
saddr.sat_port = 6;
+/*
+ * $Id: asingle.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/param.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <time.h>
#include <string.h>
#include <syslog.h>
#include <ctype.h>
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <atalk/adouble.h>
#include <netatalk/endian.h>
#include "asingle.h"
strncpy( single.path, singlefile, MAXPATHLEN );
#if DEBUG
fprintf( stderr, "opened %s for read\n", single.path );
-#endif
+#endif /* DEBUG */
if ((( rc = single_header_test()) > 0 ) &&
( single_header_read( fh, rc ) == 0 )) {
return( 0 );
num_entries = ntohs( num_entries );
#if DEBUG >= 2
fprintf( stderr, "The number of entries is %d\n", num_entries );
-#endif
+#endif /* DEBUG */
for ( ; num_entries > 0 ; num_entries-- ) {
if ( read( single.filed, (char *)entry_buf, AD_ENTRY_LEN )
!= AD_ENTRY_LEN ) {
fprintf( stderr, "entry_id\t%d\n", entry_id );
fprintf( stderr, "\toffset\t\t%d\n", single.entry[ entry_id ].ade_off );
fprintf( stderr, "\tlength\t\t%d\n", single.entry[ entry_id ].ade_len );
-#endif
+#endif /* DEBUG */
}
/*
}
#if DEBUG
fprintf( stderr, "date_entry = %d\n", date_entry );
-#endif
+#endif /* DEBUG */
/*
* Go through and copy all the information you can get from
type[4] = creator[4] = '\0';
fprintf( stderr, "type is %s, creator is %s\n", type, creator );
}
-#endif
+#endif /* DEBUG */
}
if (( single.entry[ ADEID_COMMENT ].ade_len == 0 ) ||
( single.entry[ ADEID_COMMENT ].ade_off <= AD_HEADER_LEN )) {
+/*
+ * $Id: asingle.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _ASINGLE_H
+#define _ASINGLE_H 1
+
/* Forward Declarations */
struct FHeader;
int single_header_read(struct FHeader *fh, int version);
int single_header_test(void);
int single_read(int fork, char *buffer, int length);
+
+#endif /* _ASINGLE_H */
/*
- * $Id: hqx.c,v 1.7 2001-06-10 20:12:29 srittau Exp $
+ * $Id: hqx.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <sys/types.h>
#ifdef notdef
#if BSD >= 199006
# include <machine/endian.h>
-#else
+#else /* BSD >= 199006 */
# include <netinet/in.h>
-#endif
-#endif notdef
+#endif /* BSD >= 199006 */
+#endif /* notdef */
#include <time.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <string.h>
#include <syslog.h>
#include <ctype.h>
*/
#ifndef STDIN
# define STDIN "-"
-#endif
+#endif /* ! STDIN */
/* Yes and no
*/
#if HEXOUTPUT
FILE *rawhex, *expandhex;
-#endif
+#endif /* HEXOUTPUT */
struct hqx_file_data {
u_int32_t forklen[ NUMFORKS ];
#if DEBUG
fprintf( stderr, "megatron: entering hqx_open\n" );
-#endif
+#endif /* DEBUG */
if ( flags == O_RDONLY ) {
#if HEXOUTPUT
rawhex = fopen( "rawhex.unhex", "w" );
expandhex = fopen( "expandhex.unhex", "w" );
-#endif
+#endif /* HEXOUTPUT */
first_flag = 0;
pos = lseek( hqx.filed, 0, L_INCR );
fprintf( stderr, "megatron: current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
return( 0 );
}
}
}
fprintf( stderr, "hqx_read: fork is %s\n", forkname[ fork ] );
fprintf( stderr, "hqx_read: remaining length is %d\n", hqx.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
if ( hqx.forklen[ fork ] < 0 ) {
fprintf( stderr, "This should never happen, dude!\n" );
#if DEBUG >= 4
fprintf( stderr, "hqx_read: storedcrc\t\t%x\n", storedcrc );
fprintf( stderr, "hqx_read: observed crc\t\t%x\n\n", hqx.forkcrc[fork] );
-#endif
+#endif /* DEBUG >= 4 */
if ( storedcrc == hqx.forkcrc[ fork ] ) {
return( 0 );
}
}
#if DEBUG >= 3
fprintf( stderr, "hqx_read: readlen is %d\n", readlen );
-#endif
+#endif /* DEBUG >= 3 */
cc = hqx_7tobin( buffer, readlen );
if ( cc > 0 ) {
}
#if DEBUG >= 3
fprintf( stderr, "hqx_read: chars read is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
return( cc );
}
#if HEXOUTPUT
int headerfork;
headerfork = open( "headerfork", O_WRONLY|O_CREAT, 0622 );
-#endif
+#endif /* HEXOUTPUT */
mask = htons( 0xfcee );
hqx.headercrc = 0;
#if HEXOUTPUT
write( headerfork, &namelen, sizeof( namelen ));
-#endif
+#endif /* HEXOUTPUT */
if (( headerbuf =
(char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == 0 ) {
#if HEXOUTPUT
write( headerfork, headerbuf, ( namelen + BHH_HEADSIZ ));
-#endif
+#endif /* HEXOUTPUT */
/*
* stuff from the hqx file header
fprintf( stderr, "observed crc\t\t%x\n", hqx.headercrc );
fprintf( stderr, "\n" );
}
-#endif
+#endif /* DEBUG >= 5 */
/*
* create and modify times are figured from right now
#if DEBUG
fprintf( stderr, "hqx_7tobin: datalen entering %d\n", datalen );
fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i );
-#endif
+#endif /* DEBUG */
if ( first_flag == 0 ) {
prev_hqx8 = 0;
#if DEBUG
fprintf( stderr, "hqx_7tobin: hqx8i entering %d\n", hqx8i );
-#endif
+#endif /* DEBUG */
out_first = outbuf;
out_last = out_first + datalen;
#if HEXOUTPUT
putc( hqx8i, rawhex );
putc( hqx8[ hqx8i ], rawhex );
-#endif
+#endif /* HEXOUTPUT */
if ( prev_hqx8 == RUNCHAR ) {
if ( hqx8[ hqx8i ] == 0 ) {
*out_first = prev_hqx8;
#if HEXOUTPUT
putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
prev_out = prev_hqx8;
out_first++;
}
*out_first = prev_out;
#if HEXOUTPUT
putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
hqx8[ hqx8i ]--;
out_first++;
}
*out_first = prev_hqx8;
#if HEXOUTPUT
putc( *out_first, expandhex );
-#endif
+#endif /* HEXOUTPUT */
prev_out = prev_hqx8;
out_first++;
}
+/*
+ * $Id: hqx.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _HQX_H
+#define _HQX_H 1
+
/* Forward Declarations */
struct FHeader;
int hqx_header_write(struct FHeader *fh);
int hqx_7tobin(char *outbuf, int datalen);
int hqx7_fill(u_char *hqx7_ptr);
+
+#endif /* _HQX_H */
+/*
+ * $Id: macbin.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/param.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <string.h>
#include <strings.h>
#include <syslog.h>
*/
#ifndef STDIN
# define STDIN "-"
-#endif
+#endif /* STDIN */
/* Yes and no
*/
#if DEBUG
fprintf( stderr, "entering bin_open\n" );
-#endif
+#endif /* DEBUG */
/* call localtime so that we get the timezone offset */
bin.gmtoff = 0;
tp = localtime(&t);
if (tp)
bin.gmtoff = tp->tm_gmtoff;
-#endif
+#endif /* ! NO_STRUCT_TM_GMTOFF */
if ( flags == O_RDONLY ) { /* input */
if ( strcmp( binfile, STDIN ) == 0 ) {
}
#if DEBUG
fprintf( stderr, "opened %s for read\n", binfile );
-#endif
+#endif /* DEBUG */
if ((( rc = test_header() ) > 0 ) &&
( bin_header_read( fh, rc ) == 0 )) {
return( 0 );
#if DEBUG
fprintf( stderr, "sizeof bin.path\t\t\t%d\n", sizeof( bin.path ));
fprintf( stderr, "maxlen \t\t\t\t%d\n", maxlen );
-#endif
+#endif /* DEBUG */
strncpy( bin.path, fh->name, maxlen );
strncpy( bin.path, mtoupath( bin.path ), maxlen );
strncat( bin.path, ".bin", maxlen - strlen( bin.path ));
#if DEBUG
fprintf( stderr, "opened %s for write\n",
(options & OPTION_STDOUT) ? "(stdout)" : bin.path );
-#endif
+#endif /* DEBUG */
}
if ( bin_header_write( fh ) != 0 ) {
{
#if DEBUG
fprintf( stderr, "entering bin_close\n" );
-#endif
+#endif /* DEBUG */
if ( keepflag == KEEP ) {
return( close( bin.filed ));
} else if ( keepflag == TRASH ) {
#if DEBUG >= 3
fprintf( stderr, "bin_read: fork is %s\n", forkname[ fork ] );
fprintf( stderr, "bin_read: remaining length is %d\n", bin.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
if ( bin.forklen[ fork ] < 0 ) {
fprintf( stderr, "This should never happen, dude!\n" );
pos = lseek( bin.filed, 0, SEEK_CUR );
#if DEBUG
fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
pos %= HEADBUFSIZ;
if (pos != 0) {
pos = lseek( bin.filed, HEADBUFSIZ - pos, SEEK_CUR );
}
#if DEBUG
fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
}
return( 0 );
}
#if DEBUG >= 3
fprintf( stderr, "bin_read: readlen is %d\n", readlen );
fprintf( stderr, "bin_read: cc is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
buf_ptr = buffer;
while (( readlen > 0 ) && ( cc > 0 )) {
if (( cc = read( bin.filed, buf_ptr, readlen )) > 0 ) {
#if DEBUG >= 3
fprintf( stderr, "bin_read: cc is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
readlen -= cc;
buf_ptr += cc;
}
#if DEBUG >= 3
fprintf( stderr, "bin_read: chars read is %d\n", cc );
-#endif
+#endif /* DEBUG >= 3 */
return( cc );
}
#if DEBUG >= 3
fprintf( stderr, "bin_write: fork is %s\n", forkname[ fork ] );
fprintf( stderr, "bin_write: remaining length is %d\n", bin.forklen[fork] );
-#endif
+#endif /* DEBUG >= 3 */
if (( fork == RESOURCE ) && ( bin.forklen[ DATA ] != 0 )) {
fprintf( stderr, "Forklength error.\n" );
#if DEBUG >= 3
fprintf( stderr, "bin_write: write length is %d\n", writelen );
-#endif
+#endif /* DEBUG >= 3 */
while (( writelen > 0 ) && ( cc >= 0 )) {
cc = write( bin.filed, buf_ptr, writelen );
pos = lseek( bin.filed, 0, SEEK_CUR );
#if DEBUG
fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
pos %= HEADBUFSIZ;
if (pos != 0) { /* pad only if we need to */
pos = lseek( bin.filed, HEADBUFSIZ - pos - 1, SEEK_CUR );
}
#if DEBUG
fprintf( stderr, "current position is %ld\n", pos );
-#endif
+#endif /* DEBUG */
}
#if DEBUG
fprintf( stderr, "\n" );
-#endif
+#endif /* DEBUG */
return( length );
}
#ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */
memcpy( &fh->finder_info.fdFlags, head_buf + 73, 1 );
fh->finder_info.fdFlags &= mask;
-#else
+#else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
memcpy( &fh->finder_info.fdFlags, head_buf + 73, 2 );
#endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] );
fprintf( stderr, "\n" );
}
-#endif
+#endif /* DEBUG >= 5 */
return( 0 );
}
#ifndef MACBINARY_PLAY_NICE_WITH_OTHERS /* (RLB) */
memcpy( head_buf + 73, &fh->finder_info.fdFlags, 1 );
-#else
+#else /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
memcpy( head_buf + 73, &fh->finder_info.fdFlags, 2 );
#endif /* ! MACBINARY_PLAY_NICE_WITH_OTHERS */
fprintf( stderr, "resource fork length\t%ld\n", bin.forklen[RESOURCE] );
fprintf( stderr, "\n" );
}
-#endif
+#endif /* DEBUG >= 5 */
write_ptr = (char *)head_buf;
wc = sizeof( head_buf );
#if DEBUG
fprintf( stderr, "entering test_header\n" );
-#endif
+#endif /* DEBUG */
cc = read( bin.filed, (char *)head_buf, sizeof( head_buf ));
if ( cc < sizeof( head_buf )) {
#if DEBUG
fprintf( stderr, "was able to read HEADBUFSIZ bytes\n" );
-#endif
+#endif /* DEBUG */
/* check for macbinary III header */
if (memcmp(head_buf + 102, "mBIN", 4) == 0)
if (( head_buf[ 0 ] == 0 ) || ( head_buf[ 74 ] == 0 )) {
#if DEBUG
fprintf( stderr, "byte 0 and 74 are both zero\n" );
-#endif
+#endif /* DEBUG */
bin.headercrc = updcrc( (u_short) 0, head_buf, 124 );
memcpy(&header_crc, head_buf + 124, sizeof( header_crc ));
header_crc = ntohs( header_crc );
#if DEBUG
fprintf( stderr, "header crc didn't pan out\n" );
-#endif
+#endif /* DEBUG */
}
/* now see if we have a macbinary file. */
memcpy( &namelen, head_buf + 1, sizeof( namelen ));
#if DEBUG
fprintf( stderr, "name length is %d\n", namelen );
-#endif
+#endif /* DEBUG */
if (( namelen < 1 ) || ( namelen > 63 )) {
return( -1 );
}
#if DEBUG
fprintf( stderr, "byte 82 is zero and name length is cool\n" );
-#endif
+#endif /* DEBUG */
return( 1 );
}
+/*
+ * $Id: macbin.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _MACBIN_H
+#define _MACBIN_H 1
+
/* Forward Declarations */
struct FHeader;
int bin_header_write(struct FHeader *fh);
int test_header(void);
u_short updcrc();
+
+#endif /* _MACBIN_H */
+/*
+ * $Id: megatron.c,v 1.6 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/uio.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <time.h>
#include <ctype.h>
#include <stdio.h>
fprintf( stderr, "megatron: forkred is \t\t%d\n", forkred );
fprintf( stderr, "megatron: fh.forklen[%d] is \t%d\n", fork,
ntohl( fh.forklen[ fork ] ));
-#endif
+#endif /* DEBUG */
if (( bufc < 0 ) || ( forkred != ntohl( fh.forklen[ fork ] ))) {
fprintf( stderr, "%s: Problem with input, dude\n", path );
to_close( module, TRASH );
fprintf( stderr, "megatron: list of program links messed up\n" );
return( -1 );
}
-#endif
+#endif /* DEBUG */
for ( c = 0 ; (( c < converts ) && ( module < 0 )) ; ++c ) {
if ( strcmp( name[ c ], progname ) == 0 ) module = c;
+/*
+ * $Id: megatron.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _MEGATRON_H
+#define _MEGATRON_H 1
+
#include <atalk/adouble.h>
#ifndef STDIN
# define STDIN "-"
-#endif
+#endif /* ! STDIN */
/*
Where it matters, data stored in either of these two structs is in
#ifndef S_ISDIR
# define S_ISDIR(s) (( s & S_IFMT ) == S_IFDIR )
-#endif
+#endif /* ! S_ISDIR */
extern char *mtoupath( char *);
+
+#endif /* _MEGATRON_H */
+/*
+ * $Id: nad.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/param.h>
#include <string.h>
#include <syslog.h>
#include <dirent.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <atalk/adouble.h>
#include <netatalk/endian.h>
while ( *m != '\0' ) {
#if AD_VERSION == AD_VERSION1
if ( !isascii( *m ) || *m == '/' || ( i == 0 && *m == '.' )) {
-#else
+#else /* AD_VERSION == AD_VERSION1 */
if (!isprint(*m) || *m == '/' || ( i == 0 && (*m == '.' ))) {
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
*u++ = ':';
*u++ = hexdig[ ( *m & 0xf0 ) >> 4 ];
*u++ = hexdig[ *m & 0x0f ];
} else {
#ifdef DOWNCASE
*u++ = ( isupper( *m )) ? tolower( *m ) : *m;
-#else DOWNCASE
+#else /* DOWNCASE */
*u++ = *m;
-#endif DOWNCASE
+#endif /* DOWNCASE */
}
i++;
m++;
} else {
#ifdef DOWNCASE
*m = diatolower(*u);
-#else DOWNCASE
+#else /* DOWNCASE */
*m = *u;
-#endif DOWNCASE
+#endif /* DOWNCASE */
}
u++;
m++;
#if HEXOUTPUT
int hexfork[ NUMFORKS ];
-#endif
+#endif /* HEXOUTPUT */
struct nad_file_data {
char macname[ MAXPATHLEN + 1 ];
#if DEBUG
fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]);
fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]);
-#endif
+#endif /* DEBUG */
if ( ad_open( nad.adpath[ 0 ], ADFLAGS_DF|ADFLAGS_HF,
openflags, (int)( st.st_mode & 0666 ), &nad.ad) < 0 ) {
perror( nad.adpath[ 0 ] );
fprintf(stderr, "%s\n", nad.macname);
fprintf(stderr, "%s is adpath[0]\n", nad.adpath[0]);
fprintf(stderr, "%s is adpath[1]\n", nad.adpath[1]);
-#endif
+#endif /* DEBUG */
if ( stat( ".", &st ) < 0 ) {
perror( "stat of . failed" );
return( -1 );
fprintf( stderr, "size of resource fork\t\t%d\n",
ntohl( fh->forklen[ RESOURCE ] ));
fprintf( stderr, "get info comment\t\t\"%s\"\n", fh->comment );
-#endif
+#endif /* DEBUG */
ad_getdate(&nad.ad, AD_DATE_CREATE, &temptime);
memcpy( &fh->create_date, &temptime, sizeof( temptime ));
temptime = AD_DATE_TO_UNIX(temptime);
fprintf( stderr, "backup_date seconds\t\t%lu\n", temptime );
fprintf( stderr, "size of finder_info\t\t%d\n", sizeof( fh->finder_info ));
-#endif
+#endif /* DEBUG */
memcpy(&fh->finder_info.fdType,
ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE,
fprintf(stderr, "fh script\t\t\t%x\n", fh->finder_xinfo.fdScript);
fprintf(stderr, "fh xflags\t\t\t%x\n", fh->finder_xinfo.fdXFlags);
}
-#endif
+#endif /* DEBUG */
nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0;
ad_entry( &nad.ad, ADEID_NAME ));
fprintf( stderr, "ADEID_COMMENT\t\t\t%d\n",
ad_getentrylen( &nad.ad, ADEID_COMMENT ));
-#endif
+#endif /* DEBUG */
memcpy( &temptime, &fh->create_date, sizeof( temptime ));
ad_setdate(&nad.ad, AD_DATE_CREATE, temptime);
ad_getdate(&nad.ad, AD_DATE_MODIFY, &temptime);
temptime = AD_DATE_TO_UNIX(temptime);
fprintf(stderr, "FILEIOFF_MODIFY seconds\t\t%ld\n", temptime );
-#endif
+#endif /* DEBUG */
memset( ad_entry( &nad.ad, ADEID_FINDERI ), 0, ADEDLEN_FINDERI );
memcpy( ad_entry( &nad.ad, ADEID_FINDERI ) + FINDERIOFF_TYPE,
sizeof( fh->finder_info.fdCreator ),
ad_entry( &nad.ad, ADEID_FINDERI ));
}
-#endif
+#endif /* DEBUG */
#if HEXOUTPUT
hexfork[ DATA ] = open( "datafork", O_WRONLY|O_CREAT, 0622 );
hexfork[ RESOURCE ] = open( "resfork", O_WRONLY|O_CREAT, 0622 );
-#endif
+#endif /* HEXOUTPUT */
nad.offset[ DATA ] = nad.offset[ RESOURCE ] = 0;
ad_flush( &nad.ad, ADFLAGS_DF|ADFLAGS_HF );
#if DEBUG
fprintf( stderr, "Entering nad_read\n" );
-#endif
+#endif /* DEBUG */
if (( cc = ad_read( &nad.ad, forkeid[ fork ], nad.offset[ fork ],
forkbuf, bufc)) < 0 ) {
#if DEBUG
fprintf( stderr, "Exiting nad_read\n" );
-#endif
+#endif /* DEBUG */
return( cc );
}
#if DEBUG
fprintf( stderr, "Entering nad_write\n" );
-#endif
+#endif /* DEBUG */
#if HEXOUTPUT
write( hexfork[ fork ], forkbuf, bufc );
-#endif
+#endif /* HEXOUTPUT */
writelen = bufc;
buf_ptr = forkbuf;
+/*
+ * $Id: nad.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifndef _NAD_H
+#define _NAD_H 1
+
/* Forward Declarations */
struct FHeader;
int nad_read(int fork, char *forkbuf, int bufc);
int nad_write(int fork, char *forkbuf, int bufc);
int nad_close(int status);
+
+#endif /* _NAD_H */
-/* updcrc(3), crc(1) - calculate crc polynomials
+/*
+ * $Id: updcrc.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * updcrc(3), crc(1) - calculate crc polynomials
*
* Calculate, intelligently, the CRC of a dataset incrementally given a
* buffer full at a time.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
/* The CRC polynomial.
* These 4 values define the crc-polynomial.
#define INIT_CRC 0L /* init value: -1 0 0 */
#if 0
#define SWAPPED /* bit order: undef defined defined */
-#endif
+#endif /* 0 */
#define W 16 /* bits in CRC:16 16 16 */
/* data type that holds a W-bit unsigned integer */
#if W <= 16
# define WTYPE unsigned short
-#else
+#else /* W <= 16 */
# define WTYPE u_int32_t
-#endif
+#endif /* W <= 16 */
/* the number of bits per char: don't change it. */
#define B 8
while( cnt-- ) {
#ifndef SWAPPED
crc = (crc<<B) ^ crctab[(crc>>(W-B)) ^ *cp++];
-#else
+#else /* SWAPPED */
crc = (crc>>B) ^ crctab[(crc & ((1<<B)-1)) ^ *cp++];
-#endif SWAPPED
+#endif /* SWAPPED */
}
return( crc );
printf(" ");
}
}
-#endif
+#endif /* MAKETAB */
#ifdef TEST
/* crc should now equal magic */
buf[0] = buf[1] = buf[2] = buf[3] = 0;
printf( "magic test: %lx =?= %lx\n", crc, updcrc(-1, buf, W/B));
-#endif MAGICCHECK
+#endif /* MAGICCHECK */
}
-#endif
+#endif /* TEST */
/*
+ * $Id: nbplkup.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <netatalk/endian.h>
#include <stdio.h>
#if !defined( sun ) || !defined( i386 )
#include <stdlib.h>
-#endif sun i386
+#endif /* ! sun || ! i386 */
char *Obj = "=";
char *Type = "=";
/*
+ * $Id: nbprgstr.c,v 1.4 2001-06-29 14:14:46 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 <stdio.h>
#include <stdlib.h>
/*
+ * $Id: nbpunrgstr.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <netatalk/endian.h>
#include <netatalk/at.h>
#include <atalk/util.h>
/*
+ * $Id: pap.c,v 1.6 2001-06-29 14:14:46 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/types.h>
#include <sys/time.h>
#include <atalk/pap.h>
#include <atalk/nbp.h>
#include <atalk/util.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <stdio.h>
#include <string.h>
#include <string.h>
/* if there is a less hacky way to do this, please do it... */
#ifdef DEBUG
#define EBUG
-#endif
+#endif /* DEBUG */
#undef DEBUG
case 'W' :
waitforidle = 1;
break;
-#endif /*FUCKED*/
+#endif /* FUCKED */
case 'c' :
cuts++;
fprintf( stderr, "Bad status response!\n" );
exit( 1 );
}
-#endif /*NONZEROSTATUS*/
+#endif /* NONZEROSTATUS */
if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS ||
atpb.atp_rresiovcnt != 1 ) {
fprintf( stderr, "Bad connid in close!\n" );
exit( 1 );
}
-#endif /*ZEROCONNID*/
+#endif /* ZEROCONNID */
DEBUG( printf( "< CLOSEREPLY\n" ), fflush( stdout ));
}
if ( rseq++ == 0xffff ) rseq = 1;
}
-#endif /*notdef*/
+#endif /* notdef */
data = 1;
port = ssat.sat_port;
fprintf( stderr, "Bad data response!\n" );
exit( 1 );
}
-#endif /*ZEROCONNID*/
+#endif /* ZEROCONNID */
if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_DATA ) {
fprintf( stderr, "Bad data response!\n" );
exit( 1 );
fprintf( stderr, "Bad status response!\n" );
exit( 1 );
}
-#endif /*NONZEROSTATUS*/
+#endif /* NONZEROSTATUS */
if ( ((char *)rniov[ 0 ].iov_base)[ 1 ] != PAP_STATUS ||
atpb.atp_rresiovcnt != 1 ) {
waitforprinter = 0;
}
}
-#endif /*FUCKED*/
+#endif /* FUCKED */
updatestatus( (char *) rniov[ 0 ].iov_base + 9,
((char *)rniov[ 0 ].iov_base)[ 8 ] );
/*
+ * $Id: papstatus.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/time.h>
/*
+ * $Id: pa.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include "pa.h"
/*
+ * $Id: pa.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* pa_cancel( h ) Cancel previous match start.
*/
+#ifndef _PA_H
+#define _PA_H 1
+
#ifndef FILE_H
#include <stdio.h>
-#endif
+#endif /* FILE_H */
#define PA_BUFBLK 1024
#define pa_cont(h) (*((h)->cur)=(h)->tmp,(h)->state=PA_MATCHING)
#define pa_cancel(h) ((h)->state=PA_NORMAL)
#define pa_back(h) (--((h)->cur))
+
+#endif /* _PA_H */
/*
+ * $Id: psorder.c,v 1.5 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/file.h>
#include <ctype.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <stdio.h>
#include <string.h>
#include <dirent.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include "pa.h"
#include "psorder.h"
#if DEBUG
fprintf( stderr, "Input file or stdin and stdout opened.\n" );
fprintf( stderr, "Input file descriptor is %d .\n", *infd );
-#endif
+#endif /* DEBUG */
/*
make temporary file
#if DEBUG
fprintf( stderr, "Temporary file %s created and opened.\n", tfile );
fprintf( stderr, "Temporary file descriptor is %d .\n", *tfd );
-#endif
+#endif /* DEBUG */
psinfo.firstpage = NULL;
psinfo.lastpage = NULL;
}
#if DEBUG
fprintf( stderr, "%s\n", curtok );
-#endif
+#endif /* DEBUG */
/*
* not postscript
if ( strcmp( curtok, PPSADOBE ) != 0 ) {
#if DEBUG
fprintf( stderr, "in the not postscript section of readps\n" );
-#endif
+#endif /* DEBUG */
while (( c = pa_getchar( pb )) != 0 ) {
ccread++;
(void)putc( c, tempstream );
*/
#if DEBUG
fprintf( stderr, "in the postscript section of readps\n" );
-#endif
+#endif /* DEBUG */
while (( c = pa_getchar( pb )) != 0 ) {
ccread++;
(void)putc( c, tempstream );
if ((( pc == '\r' ) || ( pc == '\n' )) && ( cc == '%' )) {
#if DEBUG
fprintf( stderr, "supposed start of match, cc = %c\n", cc );
-#endif
+#endif /* DEBUG */
pa_match( pb );
ccmatch = ccread - 1;
while ( ( c = pa_getchar( pb ) ) ) {
curtok = pa_gettok( pb );
#if DEBUG
fprintf( stderr, "%s\n", curtok );
-#endif
+#endif /* DEBUG */
if ( handletok( ccmatch, curtok ) < 0 ) {
perror( "malloc died" );
filecleanup( -1, tempfd, tempfile );
incdoc--;
#if DEBUG
fprintf( stderr, "found an EndDoc\n" );
-#endif
+#endif /* DEBUG */
} else if ( strncmp( PBEGINDOC, token, strlen( PBEGINDOC )) == 0 ) {
incdoc++;
#if DEBUG
fprintf( stderr, "found a BeginDoc\n" );
-#endif
+#endif /* DEBUG */
} else if ( !incdoc &&
( strncmp( PPAGE, token, strlen( PPAGE )) == 0 )) {
#if DEBUG
fprintf( stderr, "found a Page\n" );
-#endif
+#endif /* DEBUG */
if (( newpage = getpspage( count )) == NULL ) {
return( -1 );
}
#if DEBUG
fprintf( stderr, "page lable %s, page ord %s\n", newpage->lable,
newpage->ord );
-#endif
+#endif /* DEBUG */
} else if ( !incdoc &&
( strncmp( PPAGES, token, strlen( PPAGES )) == 0 )) {
#if DEBUG
fprintf( stderr, "found a Pages\n" );
-#endif
+#endif /* DEBUG */
psinfo.pages.offset = count;
psinfo.pages.end = strlen( token ) + count;
while ( *token++ != ':' );
if ( strncmp( ATEND, token, strlen( ATEND )) == 0 ) {
#if DEBUG
fprintf( stderr, "it is a Pages: (atend)\n" );
-#endif
+#endif /* DEBUG */
psinfo.pages.offset = 0;
psinfo.pages.end = 0;
} else {
#if DEBUG
fprintf( stderr, "number of pages %s\n", psinfo.pages.num );
fprintf( stderr, "order control number %s\n", psinfo.pages.order );
-#endif
+#endif /* DEBUG */
}
} else if ( !incdoc &&
( strncmp( PTRAILER, token, strlen( PTRAILER )) == 0 )) {
#if DEBUG
fprintf( stderr, "found the Trailer\n" );
-#endif
+#endif /* DEBUG */
if ( psinfo.trailer == 0 ) {
psinfo.trailer = count;
}
/*
+ * $Id: psorder.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifndef STDIN
# define STDIN "-"
-#endif
+#endif /* ! STDIN */
#ifndef FALSE
# define FALSE 0
# define TRUE 1
-#endif
+#endif /* ! FALSE */
#define REVCHAR 'd'
#define FORWCHAR 'u'
#!/usr/bin/perl
+# $Id: macusers,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
use strict;
use vars qw($MAC_PROCESS $PS_STR $MATCH_STR $ASIP_PORT $LSOF);
/*
- * $Id: timeout.c,v 1.2 2001-05-07 12:49:19 rufustfirefly Exp $
+ * $Id: timeout.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
char **av;
/*
- * $Id: timelord.c,v 1.4 2001-02-26 15:39:00 rufustfirefly Exp $
+ * $Id: timelord.c,v 1.5 2001-06-29 14:14:46 rufustfirefly Exp $
*
* Copyright (c) 1990,1992 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/param.h>
#include <sys/types.h>
#ifdef ultrix
openlog( p, LOG_PID );
-#else ultrix
+#else /* ultrix */
openlog( p, LOG_NDELAY|LOG_PID, LOG_DAEMON );
-#endif ultrix
+#endif /* ultrix */
/* allocate memory */
memset (&sat.sat_addr, 0, sizeof (sat.sat_addr));
+/*
+ * $Id: ad_attr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <atalk/adouble.h>
+/*
+ * $Id: ad_date.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
/*
+ * $Id: ad_flush.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
{
#ifndef USE_MMAPPED_HEADERS
int len;
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
if (( adflags & ADFLAGS_HF ) && ( ad->ad_hf.adf_flags & O_RDWR )) {
/* sync our header */
MS_SYNC | MS_INVALIDATE);
#else
msync(ad->ad_data, ad_getentryoff(ad, ADEID_RFORK));
-#endif
+#endif /* MS_SYNC */
-#else
+#else /* USE_MMAPPED_HEADERS */
if ( ad->ad_hf.adf_off != 0 ) {
if ( lseek( ad->ad_hf.adf_fd, 0L, SEEK_SET ) < 0L ) {
return( -1 );
return( -1 );
}
ad->ad_hf.adf_off = len;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
}
return( 0 );
#ifdef USE_MMAPPED_HEADERS
if (ad->ad_data != MAP_FAILED)
munmap(ad->ad_data, ad_getentryoff(ad, ADEID_RFORK));
-#endif
+#endif /* USE_MMAPPED_HEADERS */
if ( close( ad->ad_hf.adf_fd ) < 0 ) {
err = -1;
}
/*
+ * $Id: ad_lock.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1998,1999 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT for more information.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <errno.h>
#include <atalk/adouble.h>
-/* ad_mmap provides interfaces to memory mapped files. as this is the
+/*
+ * $Id: ad_mmap.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * ad_mmap provides interfaces to memory mapped files. as this is the
* case, we don't have to deal w/ temporary buffers such as
* ad_data. the ad_mmap routines are designed to not interact w/ the
* ad_read/ad_write routines to avoid confusion.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <string.h>
#include <atalk/adouble.h>
/*
- * $Id: ad_open.c,v 1.7 2001-03-21 14:36:36 rufustfirefly Exp $
+ * $Id: ad_open.c,v 1.8 2001-06-29 14:14:46 rufustfirefly Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <errno.h>
#include <syslog.h>
#ifndef MAX
#define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
/*
* AppleDouble entry default offsets.
/* make sure we don't redefine ADEDOFF_FILEI */
#ifdef ADEDOFF_FILEI
#undef ADEDOFF_FILEI
-#endif
+#endif /* ADEDOFF_FILEI */
#define ADEID_NUM_V1 5
#define ADEDOFF_NAME_V1 (AD_HEADER_LEN + ADEID_NUM_V1*AD_ENTRY_LEN)
{ADEID_RFORK, ADEDOFF_RFORK_V2, ADEDLEN_INIT},
{0, 0, 0}
};
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
#if AD_VERSION == AD_VERSION2
/* okay, unmap our old ad header and point it to our local copy */
munmap(ad->ad_data, off);
ad->ad_data = buf;
-#endif
+#endif /* USER_MMAPPED_HEADERS */
/* move the RFORK. this assumes that the RFORK is at the end */
memmove(buf + off + SHIFTDATA, buf + off,
MAP_PRIVATE, ad->ad_hf.adf_fd, 0);
if (ad->ad_data == MAP_FAILED)
goto bail_err;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
return 0;
bail_err:
return -1;
}
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
/* read in the entries */
{
#ifdef USE_MMAPPED_HEADERS
char buf[AD_ENTRY_LEN*ADEID_MAX];
-#else
+#else /* USE_MMAPPED_HEADERS */
char *buf = ad->ad_data;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
u_int16_t nentries;
int len;
static int warning = 0;
if ((ad->ad_magic != AD_MAGIC) || ((ad->ad_version != AD_VERSION1)
#if AD_VERSION == AD_VERSION2
&& (ad->ad_version != AD_VERSION2)
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
)) {
errno = EIO;
syslog(LOG_DEBUG, "ad_open: can't parse AppleDouble header.");
#ifdef USE_MMAPPED_HEADERS
if (len > sizeof(buf))
len = sizeof(buf);
-#else
+#else /* USE_MMAPPED_HEADERS */
if (len + AD_HEADER_LEN > sizeof(ad->ad_data))
len = sizeof(ad->ad_data) - AD_HEADER_LEN;
buf += AD_HEADER_LEN;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
if (read(ad->ad_hf.adf_fd, buf, len) != len) {
if (errno == 0)
errno = EIO;
if (!ad_getentryoff(ad, ADEID_RFORK)
#ifndef USE_MMAPPED_HEADERS
|| (ad_getentryoff(ad, ADEID_RFORK) > sizeof(ad->ad_data))
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
) {
syslog(LOG_DEBUG, "ad_header_read: problem with rfork entry offset.");
return -1;
MAP_PRIVATE, ad->ad_hf.adf_fd, 0);
if (ad->ad_data == MAP_FAILED)
return -1;
-#else
+#else /* USE_MMAPPED_HEADERS */
buf += len;
len = ad_getentryoff(ad, ADEID_RFORK) - ad->ad_hf.adf_off;
if (read(ad->ad_hf.adf_fd, buf, len) != len) {
syslog(LOG_DEBUG, "ad_header_read: can't read in entries.");
return -1;
}
-#endif
+#endif /* USE_MMAPPED_HEADERS */
/* fix up broken dates */
if (ad->ad_version == AD_VERSION1) {
{
#ifdef DEBUG
syslog (LOG_INFO, "ad_mkdir: Creating directory with mode %d", mode);
-#endif
+#endif /* DEBUG */
return mkdir( path, ad_mode( path, mode ) );
}
adf_lock_init(&ad->ad_hf);
#ifdef USE_MMAPPED_HEADERS
ad->ad_data = MAP_FAILED;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
ad->ad_inited = AD_INITED;
ad->ad_refcount = 1;
}
ad_close(ad, adflags);
return -1;
}
-#else
+#else /* USE_MMAPPED_HEADERS */
memset(ad->ad_data, 0, sizeof(ad->ad_data));
-#endif
+#endif /* USE_MMAPPED_HEADERS */
eid = entry_order;
while (eid->id) {
if ((ad_header_read( ad ) < 0)
#if AD_VERSION == AD_VERSION2
|| (ad_v1tov2(ad, ad_p) < 0)
-#endif
+#endif /* AD_VERSION == AD_VERSION2 */
) {
ad_close( ad, adflags );
return( -1 );
{
#ifdef USE_MMAPPED_HEADERS
off_t off;
-#endif
+#endif /* USE_MMAPPED_HEADERS */
if (ad->ad_hf.adf_fd < -1)
return -1;
}
return 0;
-#else
+#else /* USE_MMAPPED_HEADERS */
return ad_header_read(ad);
-#endif
+#endif /* USE_MMAPPED_HEADERS */
}
+/*
+ * $Id: ad_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
#define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
-#endif
+#endif /* ! MAP_FAILED */
#ifndef __inline__
#define __inline__
-#endif
+#endif /* ! __inline__ */
/* this is so that we can keep lists of fds referencing the same file
* around. that way, we can honor locks created by the same process
#ifdef USE_FLOCK_LOCKS
#define adf_lock_init(a)
#define adf_lock_free(a)
-#else
+#else /* USE_FLOCK_LOCKS */
#define adf_lock_init(a) do { \
(a)->adf_lockmax = (a)->adf_lockcount = 0; \
free((a)->adf_lock); \
adf_lock_init(a); \
} while (0)
-#endif
+#endif /* USE_FLOCK_LOCKS */
#endif /* libatalk/adouble/ad_private.h */
/*
+ * $Id: ad_read.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
#include <atalk/adouble.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
+#endif /* ! MIN */
/* XXX: this would probably benefit from pread.
* locks have to be checked before each stream of consecutive
cc = buflen;
goto ad_read_done;
}
-#endif
+#endif /* USE_MMAPPED_HEADERS */
if ( ad->ad_hf.adf_off != cc ) {
if ( lseek( ad->ad_hf.adf_fd, (off_t) cc, SEEK_SET ) < 0 ) {
return( -1 );
}
}
ad->ad_hf.adf_off += cc;
-#else
+#else /* ! USE_MMAPPED_HEADERS */
ad_read_done:
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
}
return( cc );
/*
+ * $Id: ad_sendfile.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
fd = ad_sendfile_init(ad, eid, &off, 0);
#ifdef __linux__
cc = sendfile(sock, fd, &off, len);
-#endif
+#endif /* __linux__ */
#ifdef BSD4_4
if (sendfile(fd, sock, off, len, NULL, &cc, 0) < 0)
return -1;
-#endif
+#endif /* BSD4_4 */
return cc;
}
-#endif
+#endif /* HAVE_SENDFILE_READ */
#if 0
#ifdef HAVE_SENDFILE_WRITE
ad_setentrylen(ad, eid, off);
return cc;
-#endif
+#endif /* __linux__ */
}
-#endif
-#endif
+#endif /* HAVE_SENDFILE_WRITE */
+#endif /* 0 */
/*
+ * $Id: ad_size.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
/*
+ * $Id: ad_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1995 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <errno.h>
#include <atalk/adouble.h>
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
+#endif /* ! MIN */
/* XXX: this would benefit from pwrite.
* locking has to be checked before each stream of consecutive
cc = buflen;
goto ad_write_done;
}
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
if ( ad->ad_hf.adf_off != cc ) {
if ( lseek( ad->ad_hf.adf_fd, (off_t) cc, SEEK_SET ) < 0 ) {
if (ad->ad_hf.adf_off < ad_getentryoff(ad, ADEID_RFORK))
memcpy(ad->ad_data + ad->ad_hf.adf_off, buf,
MIN(sizeof(ad->ad_data) - ad->ad_hf.adf_off, cc));
-#else
+#else /* ! USE_MMAPPED_HEADERS */
ad_write_done:
-#endif
+#endif /* ! USE_MMAPPED_HEADERS */
if ( ad->ad_eid[ eid ].ade_len < off + cc ) {
ad->ad_eid[ eid ].ade_len = off + cc;
}
/*
+ * $Id: asp_attn.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
/*
+ * $Id: asp_child.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* netatalk@itd.umich.edu
*/
+#ifndef _ASP_CHILD_H
+#define _ASP_CHILD_H 1
+
struct asp_child {
int ac_pid;
int ac_state;
#define ACSTATE_DEAD 0
#define ACSTATE_OK 1
#define ACSTATE_BAD 7
+
+#endif /* _ASP_CHILD_H */
/*
+ * $Id: asp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
/*
+ * $Id: asp_cmdreply.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#if defined(BSD) || defined(BSD4_3)
#define memmove(a, b, n) bcopy((b), (a), (n))
-#endif
+#endif /* BSD || BSD4_3 */
int asp_cmdreply( asp, result)
ASP asp;
/*
+ * $Id: asp_getreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
/*
+ * $Id: asp_getsess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <syslog.h>
#include <errno.h>
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 = ATADDR_ANYNET;
sat.sat_addr.s_node = ATADDR_ANYNODE;
case ASPFUNC_STAT :
#ifdef EBUG
printf( "asp stat\n" );
-#endif EBUG
+#endif /* EBUG */
if ( asp->asp_slen > 0 ) {
asp->cmdbuf[0] = 0;
memcpy( asp->cmdbuf + 4, asp->asp_status, asp->asp_slen );
/*
+ * $Id: asp_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <sys/time.h>
asp->asp_atp = atp;
#ifdef BSD4_4
asp->asp_sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
asp->asp_sat.sat_family = AF_APPLETALK;
asp->asp_sat.sat_addr.s_net = ATADDR_ANYNET;
asp->asp_sat.sat_addr.s_node = ATADDR_ANYNODE;
/*
+ * $Id: asp_shutdown.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
/*
+ * $Id: asp_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#if defined(BSD) || defined(BSD4_3)
#define memmove(a, b, n) bcopy((b), (a), (n))
-#endif
+#endif /* BSD || BSD4_3 */
int asp_wrtcont(ASP asp, char *buf, int *buflen)
{
/*
+ * $Id: atp_bprint.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#define BPLEN 48
#include <stdio.h>
/*
+ * $Id: atp_bufs.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef EBUG
static int numbufs = 0;
-#endif EBUG
+#endif /* EBUG */
/* only call this when the free_list is empty...
* N_MORE_BUFS must be >= one
getpid(), s, numbufs, sentcount, incount,
( ah->atph_reqpkt != NULL ) ? 1: 0, respcount );
}
-#endif EBUG
+#endif /* EBUG */
struct atpbuf *atp_alloc_buf(void)
free_list = free_list->atpbuf_next;
#ifdef EBUG
++numbufs;
-#endif EBUG
+#endif /* EBUG */
return bp;
}
free_list = bp;
#ifdef EBUG
--numbufs;
-#endif EBUG
+#endif /* EBUG */
return 0;
}
/*
+ * $Id: atp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1997 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 <sys/types.h>
#include "atp_internals.h"
#ifdef EBUG
#include <stdio.h>
-#endif EBUG
+#endif /* EBUG */
int atp_close( ah )
ATP ah;
*/
#ifdef EBUG
print_bufuse( ah, "atp_close");
-#endif EBUG
+#endif /* EBUG */
while ( ah->atph_queue != NULL ) {
cq = ah->atph_queue;
#ifdef EBUG
print_bufuse( ah, "atp_close end");
-#endif EBUG
+#endif /* EBUG */
i = ah->atph_socket;
atp_free_buf( (struct atpbuf *) ah );
/*
+ * $Id: atp_internals.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
int));
#ifdef EBUG
extern void atp_print_addr __P((char *, struct sockaddr_at *));
-#endif
+#endif /* EBUG */
-#endif
+#endif /* ATP_INTERNALS_H */
/*
+ * $Id: atp_open.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef DEBUG
printf( "<%d> atp_open\n", getpid());
-#endif
+#endif /* DEBUG */
memset(&addr, 0, sizeof(addr));
addr.sat_port = port;
#ifdef EBUG
srandom( tv.tv_sec );
-#endif
+#endif /* EBUG */
return atp;
}
/*
+ * $Id: atp_packet.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
#ifdef EBUG
#include <stdio.h>
saddr->sat_port == ATADDR_ANYPORT ? printf( "*" ) :
printf( "%d", saddr->sat_port );
}
-#endif
+#endif /* EBUG */
void atp_build_req_packet( pktbuf, tid, ctrl, atpb )
*/
#ifdef EBUG
atp_print_bufuse( ah, "recv_atp checking queue" );
-#endif
+#endif /* EBUG */
for ( pq = NULL, cq = ah->atph_queue; cq != NULL;
pq = cq, cq = cq->atpbuf_next ) {
memcpy(&ahdr, cq->atpbuf_info.atpbuf_data + 1,
print_func( rfunc );
atp_print_addr( " from", &cq->atpbuf_addr );
putchar( '\n' );
-#endif
+#endif /* EBUG */
if ((( tid & ahdr.atphd_tid ) == ahdr.atphd_tid ) &&
(( *func & rfunc ) == rfunc )
&& at_addr_eq( fromaddr, &cq->atpbuf_addr )) {
print_func( *func );
atp_print_addr( " from", fromaddr );
putchar( '\n' );
-#endif
+#endif /* EBUG */
do {
#ifdef EBUG
fflush( stdout );
-#endif
+#endif /* EBUG */
faddrlen = sizeof( struct sockaddr_at );
memset( &faddr, 0, sizeof( struct sockaddr_at ));
atp_print_addr( " from", &faddr );
putchar( '\n' );
bprint( rbuf, recvlen );
-#endif
+#endif /* EBUG */
if ( rfunc == ATP_TREL ) {
/* remove response from sent list */
for ( pq = NULL, cq = ah->atph_sent; cq != NULL;
if ( cq != NULL ) {
#ifdef EBUG
printf( "<%d> releasing transaction %hu\n", getpid(), ntohs( rtid ));
-#endif
+#endif /* EBUG */
if ( pq == NULL ) {
ah->atph_sent = cq->atpbuf_next;
} else {
/* add packet to incoming queue */
#ifdef EBUG
printf( "<%d> queuing incoming...\n", getpid() );
-#endif
+#endif /* EBUG */
if (( inbuf = atp_alloc_buf()) == NULL ) {
return -1;
}
/*
+ * $Id: atp_rreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef EBUG
atp_print_bufuse( ah, "atp_rreq" );
-#endif
+#endif /* EBUG */
while (( rc = atp_rsel( ah, atpb->atp_saddr, ATP_TREQ )) == 0 ) {
;
if ( rc != ATP_TREQ ) {
#ifdef EBUG
printf( "<%d> atp_rreq: atp_rsel returns err %d\n", getpid(), rc );
-#endif EBUG
+#endif /* EBUG */
return( rc );
}
/*
+ * $Id: atp_rresp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef EBUG
#include <stdio.h>
-#endif
+#endif /* EBUG */
#include "atp_internals.h"
#ifdef EBUG
atp_print_bufuse( ah, "atp_rresp" );
-#endif
+#endif /* EBUG */
/* check parameters
*/
if ( atpb->atp_rresiovcnt <= 0 || atpb->atp_rresiovcnt > 8 ) {
len, i );
bprint( (char *)ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data,
len + ATP_HDRSIZE );
-#endif
+#endif /* EBUG */
memcpy(atpb->atp_rresiov[ i ].iov_base,
ah->atph_resppkt[ i ]->atpbuf_info.atpbuf_data + ATP_HDRSIZE,
len );
/*
+ * $Id: atp_rsel.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1997 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef DROP_ATPTREL
static int release_count = 0;
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
int
putchar( '\n' );
bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data,
ah->atph_reqpkt->atpbuf_dlen );
-#endif
+#endif /* EBUG */
memcpy( &req_hdr, ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1,
sizeof( struct atphdr ));
#ifdef EBUG
atp_print_bufuse( ah, "atp_rsel at top" );
-#endif
+#endif /* EBUG */
if ( func == 0 ) {
func = ATP_FUNCANY;
}
if ( requesting ) {
#ifdef EBUG
printf( "<%d> atp_rsel: request pending\n", getpid());
-#endif
+#endif /* EBUG */
gettimeofday( &tv, (struct timezone *)0 );
if ( tv.tv_sec - ah->atph_reqtv.tv_sec > ah->atph_reqto ) {
if ( resend_request( ah ) < 0 ) {
printf( "<%d> atp_rsel calling recv_atp,", getpid());
atp_print_addr( " accepting from: ", &saddr );
putchar( '\n' );
-#endif EBUG
+#endif /* EBUG */
if (( recvlen = atp_recv_atp( ah, &saddr, &rfunc, ATP_TIDANY,
abuf->atpbuf_info.atpbuf_data, 0 )) >= 0 ) {
break; /* we received something */
atp_print_addr( " from: ", &saddr );
putchar( '\n' );
bprint( abuf->atpbuf_info.atpbuf_data, recvlen );
-#endif
+#endif /* EBUG */
abuf->atpbuf_dlen = recvlen;
memcpy( &resp_hdr, abuf->atpbuf_info.atpbuf_data + 1,
printf( " %hu", cb->atpbuf_info.atpbuf_xo.atpxo_tid );
atp_print_addr( " (looking for", &saddr );
printf( " %hu)\n", tid );
-#endif
+#endif /* EBUG */
if ( tv.tv_sec - cb->atpbuf_info.atpbuf_xo.atpxo_tv.tv_sec
> cb->atpbuf_info.atpbuf_xo.atpxo_reltime ) {
/* discard expired response */
#ifdef EBUG
printf( "<%d> expiring tid %hu\n", getpid(),
cb->atpbuf_info.atpbuf_xo.atpxo_tid );
-#endif
+#endif /* EBUG */
if ( pb == NULL ) {
ah->atph_sent = cb->atpbuf_next;
} else {
#ifdef EBUG
printf( "<%d> duplicate request -- re-sending XO resp\n",
getpid());
-#endif
+#endif /* EBUG */
/* matches an old response -- just re-send and reset expire */
cb->atpbuf_info.atpbuf_xo.atpxo_tv = tv;
for ( i = 0; i < 8; ++i ) {
#ifdef EBUG
printf( "<%d> EOM -- seq num %d current bitmap %d\n",
getpid(), resp_hdr.atphd_bitmap, ah->atph_rbitmap );
-#endif
+#endif /* EBUG */
mask = 1 << resp_hdr.atphd_bitmap;
ah->atph_rbitmap &= ( mask | (mask-1) );
}
if ( resp_hdr.atphd_ctrlinfo & ATP_STS ) {
#ifdef EBUG
puts( "STS" );
-#endif
+#endif /* EBUG */
req_hdr.atphd_bitmap = ah->atph_rbitmap;
memcpy(ah->atph_reqpkt->atpbuf_info.atpbuf_data + 1,
&req_hdr, sizeof( struct atphdr ));
printf( "atp_rsel: ignoring resp bm=%x tid=%d (expected %x/%d)\n",
resp_hdr.atphd_bitmap, ntohs( resp_hdr.atphd_tid ),
ah->atph_rbitmap, ah->atph_tid );
-#endif EBUG
+#endif /* EBUG */
}
if ( !ah->atph_rbitmap && ( req_hdr.atphd_ctrlinfo & ATP_XO )) {
printf( "<%d> sending TREL", getpid() );
bprint( ah->atph_reqpkt->atpbuf_info.atpbuf_data,
ah->atph_reqpkt->atpbuf_dlen );
-#endif
+#endif /* EBUG */
#ifdef DROP_ATPTREL
if (( ++release_count % 10 ) != 0 ) {
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
netddp_sendto( ah->atph_socket,
ah->atph_reqpkt->atpbuf_info.atpbuf_data,
ah->atph_reqpkt->atpbuf_dlen, 0,
sizeof( struct sockaddr_at));
#ifdef DROP_ATPTREL
}
-#endif DROP_ATPTREL
+#endif /* DROP_ATPTREL */
}
if ( ah->atph_rbitmap != 0 ) {
/*
+ * $Id: atp_sreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef EBUG
atp_print_bufuse( ah, "atp_sreq" );
-#endif
+#endif /* EBUG */
/* check parameters
*/
atp_print_addr( " to", atpb->atp_saddr );
putchar( '\n' );
bprint( req_buf->atpbuf_info.atpbuf_data, req_buf->atpbuf_dlen );
-#endif
+#endif /* EBUG */
gettimeofday( &ah->atph_reqtv, (struct timezone *)0 );
#ifdef DROPPACKETS
if (( random() % 3 ) != 2 ) {
-#endif
+#endif /* DROPPACKETS */
if ( netddp_sendto( ah->atph_socket, req_buf->atpbuf_info.atpbuf_data,
req_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr,
sizeof( struct sockaddr_at )) != req_buf->atpbuf_dlen ) {
}
#ifdef DROPPACKETS
} else printf( "<%d> atp_sreq: dropped request\n", getpid() );
-#endif
+#endif /* DROPPACKETS */
if ( atpb->atp_sreqto != 0 ) {
if ( ah->atph_reqpkt != NULL ) {
/*
+ * $Id: atp_sresp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
#ifdef EBUG
atp_print_bufuse( ah, "atp_sresp" );
-#endif
+#endif /* EBUG */
/* check parameters
*/
ah->atph_rxo ? "XO" : "", ah->atph_rtid );
atp_print_addr( " to", atpb->atp_saddr );
putchar( '\n' );
-#endif
+#endif /* EBUG */
if ( ah->atph_rxo ) {
if (( save_buf = atp_alloc_buf()) == NULL ) {
return -1;
ctrlinfo = ATP_TRESP;
#ifdef STS_RESPONSES
ctrlinfo |= ATP_STS;
-#endif STS_RESPONSES
+#endif /* STS_RESPONSES */
if ( i == atpb->atp_sresiovcnt-1 ) {
ctrlinfo |= ATP_EOM;
}
}
#ifdef DROPPACKETS
if (( random() % 3 ) != 2 ) {
-#endif
+#endif /* DROPPACKETS */
#ifdef EBUG
printf( "<%d> sending packet tid=%hu serial no.=%d\n", getpid(),
ah->atph_rtid, i );
bprint( resp_buf->atpbuf_info.atpbuf_data, resp_buf->atpbuf_dlen );
-#endif
+#endif /* EBUG */
if ( netddp_sendto( ah->atph_socket, resp_buf->atpbuf_info.atpbuf_data,
resp_buf->atpbuf_dlen, 0, (struct sockaddr *) atpb->atp_saddr,
sizeof( struct sockaddr_at )) != resp_buf->atpbuf_dlen ) {
}
#ifdef DROPPACKETS
} else printf( "<%d> atp_sresp: dropped serial no. %d\n", getpid(), i );
-#endif
+#endif /* DROPPACKETS */
/* allocate a buffer for next packet (if XO mode)
*/
if ( ah->atph_rxo && ( resp_buf = atp_alloc_buf()) == NULL ) {
ah->atph_sent = save_buf;
#ifdef EBUG
printf( "<%d> saved XO response\n", getpid());
-#endif
+#endif /* EBUG */
}
return 0;
}
/*
+ * $Id: cnid_add.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
* cnid_add (db, dev, ino, did, name, hint):
* add a name to the CNID database. we use both dev/ino and did/name
- * to keep track of things. */
+ * to keep track of things.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <errno.h>
#include <syslog.h>
+/*
+ * $Id: cnid_close.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <syslog.h>
#include <db.h>
#include <errno.h>
/*
+ * $Id: cnid_delete.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
* cnid_delete: delete a CNID from the database
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <string.h>
#include <errno.h>
+/*
+ * $Id: cnid_get.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
+/*
+ * $Id: cnid_lookup.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
/*
+ * $Id: cnid_meta.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
+/*
+ * $Id: cnid_meta.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#define CNID_META_CNID_LEN 4
#define CNID_META_MDATE_LEN 4 /* space for 8 */
#define CNID_META_CDATE_LEN 4 /* space for 8 */
+/*
+ * $Id: cnid_nextid.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <db.h>
#include <atalk/adouble.h>
/*
+ * $Id: cnid_open.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
* so, CNID_START begins at 3.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <sys/param.h>
#include <sys/stat.h>
#include <syslog.h>
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
#define ROOTINFO "RootInfo"
#define ROOTINFO_LEN 8
if (version != htonl(DBVERSION)) {
/* fix up stuff */
}
-#endif
+#endif /* 0 */
/* did/macname mapping. btree this one. */
dbi.bt_compare = compare_mac;
+/*
+ * $Id: cnid_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifndef LIBATALK_CNID_PRIVATE_H
#define LIBATALK_CNID_PRIVATE_H 1
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <db.h>
#ifndef __inline__
#define __inline__
-#endif
+#endif /* __inline__ */
/* construct db_cnid data. NOTE: this is not re-entrant. */
static __inline__ char *make_cnid_data(const struct stat *st,
+/*
+ * $Id: cnid_resolve.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
+/*
+ * $Id: cnid_update.c,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
/*
+ * $Id: flock.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static int _flock_dummy;
#ifndef HAVE_FLOCK
#include <sys/types.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <errno.h>
#define LOCK_SH 1
/*
+ * $Id: getusershell.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getusershell.c 5.6 (Berkeley) 6/1/90";
"/bin/sh", "/bin/csh",
#ifdef _IBMR2
"/bin/ksh",
-#endif _IBMR2
+#endif /* _IBMR2 */
0
};
return (shells);
}
-# endif ultrix
+# endif /* ultrix */
+/*
+ * $Id: inet_aton.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <netinet/in.h>
#if defined(ultrix) || (defined(sun) && defined(__svr4__))
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned) 0xffffffff)
-#endif
+#endif /* ! INADDR_NONE */
int inet_aton(const char *name, struct in_addr *addr)
{
return 1;
}
-#endif
+#endif /* ultrix || ( sun && __svr4__ ) */
/*
+ * $Id: mktemp.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)mktemp.c 5.9 (Berkeley) 6/1/90";
/*NOTREACHED*/
}
-# endif ultrix
+# endif /* ultrix */
-/* taken from the quota-1.55 used on linux. here's the bsd copyright:
+/*
+ * $Id: rquota_xdr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
+ * taken from the quota-1.55 used on linux. here's the bsd copyright:
*
* Copyright (c) 1980, 1990 Regents of the University of California. All
* rights reserved.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h> /* to get __GNU_LIBRARY__ */
/*
+ * $Id: strcasecmp.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static int _strcasecmp_dummy;
return (0);
}
-# endif ibm032
+# endif /* ibm032 */
+/*
+ * $Id: strdup.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
return new;
}
-#endif
+#endif /* ultrix */
-/*-
+/*
+ * $Id: strstr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)strstr.c 5.2 (Berkeley) 1/26/91";
# if defined(ibm032) || (defined(sun) && defined(i386))
#ifdef sun
#define const
-#endif sun
+#endif /* sun */
#include <sys/types.h>
#include <string.h>
}
return ((char *)s);
}
-# endif ibm03 sun i386
+# endif /* ibm03 sun i386 */
/*
+ * $Id: dsi_attn.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* MIN */
/* send an attention. this may get called at any time, so we can't use
* DSI buffers to send one. */
/*
+ * $Id: dsi_close.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
/*
+ * $Id: dsi_cmdreply.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <atalk/dsi.h>
/*
+ * $Id: dsi_getsess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <signal.h>
#include <sys/wait.h>
/*
+ * $Id: dsi_getstat.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
/*
+ * $Id: dsi_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
/*
+ * $Id: dsi_opensess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
/*
+ * $Id: dsi_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
/*
+ * $Id: dsi_read.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <signal.h>
#include <sys/types.h>
#include <sys/time.h>
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! min */
/* streaming i/o for afp_read. this is all from the perspective of the
* client. it basically does the reverse of dsi_write. on first entry,
/*
+ * $Id: dsi_stream.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#define USE_WRITEV
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#ifdef USE_WRITEV
#include <sys/uio.h>
-#endif
+#endif /* USE_WRITEV */
#include <syslog.h>
#include <atalk/dsi.h>
struct iovec iov[2];
size_t towrite;
ssize_t len;
-#endif
+#endif /* USE_WRITEV */
block[0] = dsi->header.dsi_flags;
block[1] = dsi->header.dsi_command;
}
}
-#else
+#else /* USE_WRITEV */
/* write the header then data */
if ((dsi_stream_write(dsi, block, sizeof(block)) != sizeof(block)) ||
(dsi_stream_write(dsi, buf, length) != length)) {
sigprocmask(SIG_SETMASK, &oldset, NULL);
return 0;
}
-#endif
+#endif /* USE_WRITEV */
sigprocmask(SIG_SETMASK, &oldset, NULL);
return 1;
/*
+ * $Id: dsi_tcp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997, 1998 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#define USE_TCP_NODELAY
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <errno.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
-#endif
+#endif /* HAVE_STDINT_H */
#include <sys/ioctl.h>
#include <net/if.h>
#ifdef __svr4__
#include <sys/sockio.h>
-#endif
+#endif /* __svr4__ */
#ifdef TCPWRAP
#include <tcpd.h>
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;
-#endif
+#endif /* TCPWRAP */
#include <atalk/dsi.h>
#include <atalk/compat.h>
#ifndef DSI_TCPMAXPEND
#define DSI_TCPMAXPEND 20 /* max # of pending connections */
-#endif
+#endif /* DSI_TCPMAXPEND */
#ifndef DSI_TCPTIMEOUT
#define DSI_TCPTIMEOUT 120 /* timeout in seconds for connections */
-#endif
+#endif /* ! DSI_TCPTIMEOUT */
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
static void dsi_tcp_close(DSI *dsi)
{
dsi->socket = -1;
}
}
-#endif
+#endif /* TCPWRAP */
if (dsi->socket < 0)
return -1;
#ifdef SO_REUSEADDR
port = 1;
setsockopt(dsi->serversock, SOL_SOCKET, SO_REUSEADDR, &port, sizeof(port));
-#endif
+#endif /* SO_REUSEADDR */
#ifdef USE_TCP_NODELAY
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
-#endif
+#endif /* ! SOL_TCP */
port = 1;
setsockopt(dsi->serversock, SOL_TCP, TCP_NODELAY, &port, sizeof(port));
-#endif
+#endif /* USE_TCP_NODELAY */
/* now, bind the socket and set it up for listening */
if ((bind(dsi->serversock, (struct sockaddr *) &dsi->server,
#ifndef IFF_SLAVE
#define IFF_SLAVE 0
-#endif
+#endif /* ! IFF_SLAVE */
if (ioctl(dsi->serversock, SIOCGIFFLAGS, &ifr) < 0)
continue;
/*
+ * $Id: dsi_tickle.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <sys/types.h>
/*
+ * $Id: dsi_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
/* this streams writes */
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <string.h>
#include <atalk/dsi.h>
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
/* initialize relevant things for dsi_write. this returns the amount
* of data in the data buffer. the interface has been reworked to allow
/*
+ * $Id: nbp_conf.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
int nbp_parse __P((char *, struct nbpnve *, int));
int nbp_match __P((struct nbpnve *, struct nbpnve *, int));
-#endif
+#endif /* NBP_CONF_H */
/*
+ * $Id: nbp_lkup.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1997 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#include <atalk/netddp.h>
#include <atalk/ddp.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <errno.h>
#include "nbp_conf.h"
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
int nbp_lookup( obj, type, zone, nn, nncnt, ataddr )
const char *obj, *type, *zone;
*data++ = DDPTYPE_NBP;
#ifdef MACOSX_SERVER
nh.nh_op = from.sat_addr.s_node ? NBPOP_BRRQ : NBPOP_LKUP;
-#else
+#else /* MACOSX_SERVER */
nh.nh_op = NBPOP_BRRQ;
-#endif
+#endif /* MACOSX_SERVER */
nh.nh_cnt = 1;
nh.nh_id = ++nbp_id;
addr.sat_addr.s_net = ATADDR_ANYNET;
addr.sat_addr.s_node = ATADDR_BCAST;
}
-#endif
+#endif /* MACOSX_SERVER */
addr.sat_port = nbp_port;
cnt = 0;
/*
+ * $Id: nbp_rgstr.c,v 1.3 2001-06-29 14:14:46 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 <string.h>
#include <sys/types.h>
#include <atalk/ddp.h>
#include <atalk/netddp.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include "nbp_conf.h"
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
int nbp_rgstr( sat, obj, type, zone )
struct sockaddr_at *sat;
/*
+ * $Id: nbp_unrgstr.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1997 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
#include <sys/types.h>
#include <atalk/netddp.h>
#include <atalk/ddp.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include "nbp_conf.h"
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature. */
#ifndef SOCKLEN_T
#define SOCKLEN_T unsigned int
-#endif
+#endif /* ! SOCKLEN_T */
int nbp_unrgstr( obj, type, zone, addr )
const char *obj, *type, *zone;
memcpy(&to.sat_addr, addr, sizeof(struct at_addr));
#ifdef BSD4_4
to.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
if ( nbp_port == 0 ) {
if (( se = getservbyname( "nbp", "ddp" )) == NULL ) {
/*
+ * $Id: nbp_util.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1997 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <string.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#ifdef BSD4_4
nn->nn_sat.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
nn->nn_sat.sat_family = AF_APPLETALK;
nn->nn_sat.sat_addr.s_net = nt.nt_net;
nn->nn_sat.sat_addr.s_node = nt.nt_node;
/*
+ * $Id: netddp_open.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static int _netddp_open_dummy;
#ifdef MACOSX_SERVER
#include <at/appletalk.h>
#include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
#include <netatalk/at.h>
#include <atalk/netddp.h>
bridge->sat_addr.s_node = baddress.node;
bridge->sat_port = baddress.socket;
}
-#else
+#else /* MACOSX_SERVER */
int len;
if ((s = socket( AF_APPLETALK, SOCK_DGRAM, 0 )) < 0)
close(s);
return -1;
}
-#endif
+#endif /* MACOSX_SERVER */
return s;
}
/*
+ * $Id: netddp_recvfrom.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static int _netddp_recvfrom_dummy;
#ifndef NO_DDP
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#ifdef MACOSX_SERVER
#include <at/appletalk.h>
#include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
#include <netatalk/at.h>
#include <netatalk/endian.h>
#ifndef MAX
#define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
#ifdef MACOSX_SERVER
int netddp_recvfrom(int fd, void *buf, int buflen, unsigned int dummy,
/*
+ * $Id: netddp_sendto.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static int _netddp_sendto_dummy;
#ifndef NO_DDP
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#ifdef MACOSX_SERVER
#include <at/appletalk.h>
#include <at/ddp.h>
-#endif
+#endif /* MACOSX_SERVER */
#include <netatalk/at.h>
#include <netatalk/endian.h>
#ifndef MAX
#define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
+#endif /* ! MAX */
#ifdef MACOSX_SERVER
int netddp_sendto(int fd, void *buf, int buflen, unsigned int dummy,
/*
+ * $Id: pap_child.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* netatalk@itd.umich.edu
*/
+#ifndef _PAP_CHILD_H
+#define _PAP_CHILD_H 1
+
struct pap_child {
int ac_pid;
int ac_state;
#define ACSTATE_DEAD 0
#define ACSTATE_OK 1
#define ACSTATE_BAD 7
+
+#endif /* _PAP_CHILD_H */
-/* close the connection */
+/*
+ * $Id: pap_close.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * close the connection
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
int pap_close(PAP pap)
{
+/*
+ * $Id: pap_init.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
PAP pap_init(ATP atp)
{
pap->pap_atp = atp;
#ifdef BSD4_4
pap->pap_sat.sat_len = sizeof(struct sockaddr_at);
-#endif
+#endif /* BSD4_4 */
pap->pap_sat.sat_family = AF_APPLETALK;
pap->pap_sat.sat_addr.s_net = ATADDR_ANYNET;
pap->pap_sat.sat_addr.s_node = ATADDR_ANYNODE;
-/* moved over from bin/pap/pap.c */
+/*
+ * $Id: pap_open.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * moved over from bin/pap/pap.c
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
static struct {
PAP pap;
-/* taken from bin/pap/pap.c */
+/*
+ * $Id: pap_read.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * taken from bin/pap/pap.c
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
int pap_read(PAP pap)
{
+/*
+ * $Id: pap_sendstatus.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
int pap_sendstatus(PAP pap)
{
/*
+ * $Id: pap_slinit.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
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 = ATADDR_ANYNET;
sat.sat_addr.s_node = ATADDR_ANYNODE;
case PAPFUNC_STAT:
#ifdef EBUG
printf( "pap stat\n" );
-#endif EBUG
+#endif /* EBUG */
if ( pap->pap_slen > 0 ) {
pap->cmdbuf[0] = 0;
bcopy( pap->pap_status, pap->cmdbuf + 4, pap->pap_slen );
-/* send a tickle */
+/*
+ * $Id: pap_tickle.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
+ * send a tickle
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
void pap_tickle(PAP pap, const u_int8_t connid, struct sockaddr_at *sat)
{
+/*
+ * $Id: cdefs.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1
#ifdef __STDC__
#define __P(args) args
-#else
+#else /* __STDC__ */
#define __P(args) ()
-#endif
+#endif /* __STDC__ */
#endif /* sys/cdefs.h */
/*
+ * $Id: aarp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/time.h>
#ifndef _IBMR2
#include <sys/kernel.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
#include <net/if.h>
#include <net/route.h>
#include <net/af.h>
#include <net/spl.h>
#include <sys/errno.h>
#include <sys/err_rec.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
#include "at.h"
#include "at_var.h"
#ifdef GATEWAY
#define AARPTAB_BSIZ 16
#define AARPTAB_NB 37
-#else
+#else /* GATEWAY */
#define AARPTAB_BSIZ 9
#define AARPTAB_NB 19
-#endif GATEWAY
+#endif /* GATEWAY */
#define AARPTAB_SIZE (AARPTAB_BSIZ * AARPTAB_NB)
struct aarptab aarptab[AARPTAB_SIZE];
int aarptab_size = AARPTAB_SIZE;
#ifdef sun
extern struct ether_addr etherbroadcastaddr;
-#else sun
+#else /* sun */
extern u_char etherbroadcastaddr[6];
-#endif sun
+#endif /* sun */
u_char atmulticastaddr[ 6 ] = {
0x09, 0x00, 0x07, 0xff, 0xff, 0xff,
sat->sat_addr.s_net ) {
break;
}
-#else BSD4_4
+#else /* BSD4_4 */
if ( ifa->ifa_addr.sa_family != AF_APPLETALK ) {
continue;
}
ntohs( sat->sat_addr.s_net ) <= ntohs( aa->aa_lastnet )) {
break;
}
-#endif BSD4_4
+#endif /* BSD4_4 */
}
return( ifa );
}
m->m_len = sizeof( *ea );
m->m_pkthdr.len = sizeof( *ea );
MH_ALIGN( m, sizeof( *ea ));
-#else BSD4_4
+#else /* BSD4_4 */
if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) {
return;
}
m->m_len = sizeof( *ea );
m->m_off = MMAXOFF - sizeof( *ea );
-#endif BSD4_4
+#endif /* BSD4_4 */
ea = mtod( m, struct ether_aarp *);
bzero((caddr_t)ea, sizeof( *ea ));
#ifdef sun
bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
/*
* We need to check whether the output ethernet type should
#ifdef sun
bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( sizeof( struct llc ) +
sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
#ifdef BSD4_4
M_PREPEND( m, sizeof( struct llc ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
m->m_len += sizeof( struct llc );
m->m_off -= sizeof( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;
#ifdef sun
bcopy((caddr_t)ðerbroadcastaddr, (caddr_t)&eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
ea->aarp_spa = AA_SAT( aa )->sat_addr.s_node;
ea->aarp_tpa = sat->sat_addr.s_node;
#ifdef BSD4_4
sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
sa.sa_family = AF_UNSPEC;
(*ac->ac_if.if_output)(&ac->ac_if, m, &sa );
}
struct sockaddr_at *destsat;
#ifdef sun
struct ether_addr *desten;
-#else sun
+#else /* sun */
u_char *desten;
-#endif sun
+#endif /* sun */
{
struct at_ifaddr *aa;
struct ifaddr ifa;
#ifdef sun
bcopy( (caddr_t)ðerbroadcastaddr, (caddr_t)desten,
sizeof( etherbroadcastaddr ));
-#else sun
+#else /* sun */
bcopy( (caddr_t)etherbroadcastaddr, (caddr_t)desten,
sizeof( etherbroadcastaddr ));
-#endif sun
+#endif /* sun */
}
return( 1 );
}
#ifndef BSD4_4
IF_ADJ( m );
-#endif BSD4_4
+#endif /* BSD4_4 */
if ( m->m_len < sizeof( struct arphdr )) {
goto out;
m_freem( m );
return;
}
-#else sun
+#else /* sun */
if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )ac->ac_enaddr,
sizeof( ac->ac_enaddr ))) {
m_freem( m );
return;
}
-#endif sun
+#endif /* sun */
/*
* Check if from broadcast address. This could be a more robust
m_freem( m );
return;
}
-#else sun
+#else /* sun */
if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )etherbroadcastaddr,
sizeof( etherbroadcastaddr ))) {
#ifndef _IBMR2
#ifdef ultrix
mprintf( LOG_ERR,
-#else ultrix
+#else /* ultrix */
log( LOG_ERR,
-#endif ultrix
+#endif /* ultrix */
"aarp: source is broadcast!\n" );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
m_freem( m );
return;
}
-#endif sun
+#endif /* sun */
op = ntohs( ea->aarp_op );
bcopy( ea->aarp_tpnet, &net, sizeof( net ));
#ifndef _IBMR2
#ifdef ultrix
mprintf( LOG_ERR,
-#else ultrix
+#else /* ultrix */
log( LOG_ERR,
-#endif ultrix
+#endif /* ultrix */
"aarp: duplicate AT address!! %x:%x:%x:%x:%x:%x\n",
ea->aarp_sha[ 0 ], ea->aarp_sha[ 1 ], ea->aarp_sha[ 2 ],
ea->aarp_sha[ 3 ], ea->aarp_sha[ 4 ], ea->aarp_sha[ 5 ]);
-#endif _IBMR2
+#endif /* ! _IBMR2 */
m_freem( m );
return;
}
sat.sat_family = AF_UNSPEC;
bcopy( aat->aat_enaddr, (*(struct sockaddr *)&sat).sa_data,
sizeof( aat->aat_enaddr ));
-#else _IBMR2
+#else /* _IBMR2 */
sat.sat_family = AF_APPLETALK;
sat.sat_addr = spa;
-#endif _IBMR2
+#endif /* _IBMR2 */
(*ac->ac_if.if_output)( &ac->ac_if, aat->aat_hold,
(struct sockaddr *)&sat );
aat->aat_hold = 0;
#ifdef sun
bcopy(( caddr_t )&ac->ac_enaddr, ( caddr_t )ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
bcopy(( caddr_t )ac->ac_enaddr, ( caddr_t )ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
eh = (struct ether_header *)sa.sa_data;
#ifdef sun
bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )&eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
bcopy(( caddr_t )ea->aarp_tha, ( caddr_t )eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
if ( aa->aa_flags & AFA_PHASE2 ) {
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( sizeof( struct llc ) +
sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
#ifdef BSD4_4
M_PREPEND( m, sizeof( struct llc ), M_DONTWAIT );
if ( m == NULL ) {
m_freem( m );
return;
}
-#else BSD4_4
+#else /* BSD4_4 */
MGET( m0, M_DONTWAIT, MT_HEADER );
if ( m0 == NULL ) {
m_freem( m );
m = m0;
m->m_off = MMAXOFF - sizeof( struct llc );
m->m_len = sizeof ( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;
} else {
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
}
ea->aarp_tpnode = ea->aarp_spnode;
#ifdef BSD4_4
sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
sa.sa_family = AF_UNSPEC;
(*ac->ac_if.if_output)( &ac->ac_if, m, &sa );
return;
m->m_len = sizeof( *ea );
m->m_pkthdr.len = sizeof( *ea );
MH_ALIGN( m, sizeof( *ea ));
-#else BSD4_4
+#else /* BSD4_4 */
if (( m = m_get( M_DONTWAIT, MT_DATA )) == NULL ) {
return;
}
m->m_len = sizeof( *ea );
m->m_off = MMAXOFF - sizeof( *ea );
-#endif BSD4_4
+#endif /* BSD4_4 */
ea = mtod( m, struct ether_aarp *);
bzero((caddr_t)ea, sizeof( *ea ));
#ifdef sun
bcopy((caddr_t)&ac->ac_enaddr, (caddr_t)ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#else sun
+#else /* sun */
bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->aarp_sha,
sizeof( ea->aarp_sha ));
-#endif sun
+#endif /* sun */
eh = (struct ether_header *)sa.sa_data;
#ifdef sun
bcopy((caddr_t)atmulticastaddr, (caddr_t)&eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( sizeof( struct llc ) +
sizeof( struct ether_aarp ));
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = sizeof( struct llc ) + sizeof( struct ether_aarp );
-#endif sun i386
+#endif /* sun && i386 */
#ifdef BSD4_4
M_PREPEND( m, sizeof( struct llc ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
m->m_len += sizeof( struct llc );
m->m_off -= sizeof( struct llc );
-#endif BSD4_4
+#endif /* BSD4_4 */
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;
#ifdef sun
bcopy((caddr_t)ðerbroadcastaddr, (caddr_t)&eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#else sun
+#else /* sun */
bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
-#endif sun
+#endif /* sun */
#if defined( sun ) && defined( i386 )
eh->ether_type = htons( ETHERTYPE_AARP );
-#else sun i386
+#else /* sun && i386 */
eh->ether_type = ETHERTYPE_AARP;
-#endif sun i386
+#endif /* sun && i386 */
ea->aarp_spa = ea->aarp_tpa = AA_SAT( aa )->sat_addr.s_node;
}
#ifdef BSD4_4
sa.sa_len = sizeof( struct sockaddr );
-#endif BSD4_4
+#endif /* BSD4_4 */
sa.sa_family = AF_UNSPEC;
(*ac->ac_if.if_output)(&ac->ac_if, m, &sa );
aa->aa_probcnt--;
/*
+ * $Id: aarp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
- */
-
-/*
+ *
* This structure is used for both phase 1 and 2. Under phase 1
* the net is not filled in. It is in phase 2. In both cases, the
* hardware address length is (for some unknown reason) 4. If
* anyone at Apple could program their way out of paper bag, it
* would be 1 and 3 respectively for phase 1 and 2.
*/
+
+#ifndef _AARP_H
+#define _AARP_H 1
+
union aapa {
u_char ap_pa[4];
struct ap_node {
#ifdef KERNEL
struct aarptab *aarptnew();
int aarpprobe();
-#endif
+#endif /* KERNEL */
+
+#endif /* _AARP_H */
/*
+ * $Id: at.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
*
* All Rights Reserved. See COPYRIGHT.
#include <sys/socket.h>
#include <asm/types.h>
#include <linux/atalk.h>
-#else
+#else /* linux */
#include <sys/types.h>
#include <netinet/in.h> /* so that we can deal with sun's s_net #define */
*/
#ifdef ATPROTO_DDP
#undef ATPROTO_DDP
-#endif
+#endif /* ATPROTO_DDP */
#define ATPROTO_DDP 0
#define ATPROTO_AARP 254
struct at_addr {
#ifdef s_net
#undef s_net
-#endif
+#endif /* s_net */
u_short s_net;
u_char s_node;
};
#ifdef BSD4_4
u_char sat_len;
u_char sat_family;
-#else BSD4_4
+#else /* BSD4_4 */
short sat_family;
-#endif BSD4_4
+#endif /* BSD4_4 */
u_char sat_port;
struct at_addr sat_addr;
#ifdef notdef
u_short su_interface;
} sh_un;
} sat_hints;
-#else notdef
+#else /* notdef */
char sat_zero[ 8 ];
-#endif notdef
+#endif /* notdef */
};
struct netrange {
#ifdef KERNEL
extern struct domain atalkdomain;
extern struct protosw atalksw[];
-#endif
+#endif /* KERNEL */
#endif /* linux */
-#endif __AT_HEADER__
+#endif /* __AT_HEADER__ */
/*
+ * $Id: at_control.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/param.h>
#include <sys/systm.h>
#ifdef ibm032
#include <sys/dir.h>
-#endif ibm032
+#endif /* ibm032 */
#include <sys/user.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>
#ifndef _IBMR2
#include <sys/kernel.h>
-#endif _IBMR2
+#endif /* ! _IBMR2 */
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <net/if.h>
#include <netinet/if_ether.h>
#ifdef _IBMR2
#include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
#include "at.h"
#include "at_var.h"
(a)->sat_family == (b)->sat_family && \
(a)->sat_addr.s_net == (b)->sat_addr.s_net && \
(a)->sat_addr.s_node == (b)->sat_addr.s_node )
-#else BSD4_4
+#else /* BSD4_4 */
atalk_hash( sat, hp )
struct sockaddr_at *sat;
struct afhash *hp;
}
return( sat1->sat_addr.s_net == sat2->sat_addr.s_net );
}
-#endif BSD4_4
+#endif /* BSD4_4 */
at_control( cmd, data, ifp )
int cmd;
#ifdef BSD4_4
struct at_aliasreq *ifra = (struct at_aliasreq *)data;
struct at_ifaddr *aa0;
-#endif BSD4_4
+#endif /* BSD4_4 */
struct at_ifaddr *aa = 0;
struct mbuf *m;
struct ifaddr *ifa;
return( EADDRNOTAVAIL );
}
/*FALLTHROUGH*/
-#endif BSD4_4
+#endif /* BSD4_4 */
case SIOCSIFADDR:
#ifdef BSD4_4
if ( suser( u.u_cred, &u.u_acflag )) {
return( EPERM );
}
-#else BSD4_4
+#else /* BSD4_4 */
if ( !suser()) {
return( EPERM );
}
-#endif BSD4_4
+#endif /* BSD4_4 */
sat = satosat( &ifr->ifr_addr );
nr = (struct netrange *)sat->sat_zero;
aa->aa_ifa.ifa_addr = (struct sockaddr *)&aa->aa_addr;
aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_addr;
aa->aa_ifa.ifa_netmask = (struct sockaddr *)&aa->aa_netmask;
-#endif BSD4_4
+#endif /* BSD4_4 */
/*
* Set/clear the phase 2 bit.
case SIOCGIFADDR:
#ifdef BSD4_4
*(struct sockaddr_at *)&ifr->ifr_addr = aa->aa_addr;
-#else BSD4_4
+#else /* BSD4_4 */
ifr->ifr_addr = aa->aa_addr;
-#endif BSD4_4
+#endif /* BSD4_4 */
break;
case SIOCSIFADDR:
}
m_free( dtom( aa0 ));
break;
-#endif BSD4_4
+#endif /* BSD4_4 */
default:
if ( ifp == 0 || ifp->if_ioctl == 0 )
struct sockaddr_at netsat;
int error;
u_short net;
-#endif BSD4_4
+#endif /* ! BSD4_4 */
if ( aa->aa_flags & AFA_ROUTE ) {
#ifdef BSD4_4
return( error );
}
aa->aa_ifa.ifa_flags &= ~IFA_ROUTE;
-#else BSD4_4
+#else /* BSD4_4 */
if ( ifp->if_flags & IFF_LOOPBACK ) {
rtinit( &aa->aa_addr, &aa->aa_addr, SIOCDELRT, RTF_HOST );
} else {
}
}
}
-#endif BSD4_4
+#endif /* BSD4_4 */
aa->aa_flags &= ~AFA_ROUTE;
}
return( 0 );
struct netrange nr, onr;
#ifdef BSD4_4
struct sockaddr_at oldaddr;
-#else BSD4_4
+#else /* BSD4_4 */
struct sockaddr oldaddr;
-#endif BSD4_4
+#endif /* BSD4_4 */
struct sockaddr_at netaddr;
int s = splimp(), error = 0, i, j, netinc, nodeinc, nnets;
u_short net;
if ( ifp->if_flags & IFF_LOOPBACK ) {
#ifdef BSD4_4
AA_SAT( aa )->sat_len = sat->sat_len;
-#endif BSD4_4
+#endif /* BSD4_4 */
AA_SAT( aa )->sat_family = AF_APPLETALK;
AA_SAT( aa )->sat_addr.s_net = sat->sat_addr.s_net;
AA_SAT( aa )->sat_addr.s_node = sat->sat_addr.s_node;
aa->aa_netmask.sat_family = AF_APPLETALK;
aa->aa_netmask.sat_addr.s_net = 0xffff;
aa->aa_netmask.sat_addr.s_node = 0;
-#endif BSD4_4
+#endif /* BSD4_4 */
if ( ifp->if_flags & IFF_LOOPBACK ) {
#ifndef BSD4_4
rtinit( &aa->aa_addr, &aa->aa_addr, (int)SIOCADDRT,
RTF_HOST|RTF_UP );
-#else BSD4_4
+#else /* ! BSD4_4 */
error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
} else {
#ifndef BSD4_4
/*
}
}
}
-#else BSD4_4
+#else /* ! BSD4_4 */
error = rtinit( &(aa->aa_ifa), (int)RTM_ADD, RTF_UP );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
}
if ( error ) {
aa->aa_addr = oldaddr;
#ifdef BSD4_4
aa->aa_ifa.ifa_flags |= IFA_ROUTE;
-#endif BSD4_4
+#endif /* BSD4_4 */
aa->aa_flags |= AFA_ROUTE;
splx( s );
return( 0 );
/*
+ * $Id: at_proto.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
*
* All Rights Reserved. See COPYRIGHT.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/protosw.h>
#include <sys/domain.h>
#include <sys/types.h>
extern int ddp_ifoutput();
extern int ddp_ifinput();
extern int ddp_ifioctl();
-#endif ultrix
+#endif /* ultrix */
struct protosw atalksw[] = {
{
#ifdef ultrix
/* interface hooks */
ddp_ifoutput, ddp_ifinput, ddp_ifioctl, 0,
-#endif ultrix
+#endif /* ultrix */
},
};
/*
+ * $Id: at_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
*
* All Rights Reserved. See COPYRIGHT.
*/
+#ifndef _ATVAR_H
+#define _ATVAR_H 1
+
/*
* For phase2, we need to keep not only our address on an interface,
* but also the legal networks on the interface.
struct sockaddr_at aa_addr;
struct sockaddr_at aa_broadaddr;
struct sockaddr_at aa_netmask;
-#else BSD4_4
+#else /* BSD4_4 */
# define aa_addr aa_ifa.ifa_addr
# define aa_broadaddr aa_ifa.ifa_broadaddr
# define aa_dstaddr aa_ifa.ifa_dstaddr
-#endif BSD4_4
+#endif /* BSD4_4 */
int aa_flags;
u_short aa_firstnet, aa_lastnet;
int aa_probcnt;
#define ifra_dstaddr ifra_broadaddr
struct sockaddr_at ifra_mask;
};
-#endif BSD4_4
+#endif /* BSD4_4 */
#define AA_SAT(aa) \
((struct sockaddr_at *)&((struct at_ifaddr *)(aa))->aa_addr)
struct at_ifaddr *at_ifaddr;
struct ifqueue atintrq1, atintrq2;
int atdebug;
-#endif
+#endif /* KERNEL */
+
+#endif /* _ATVAR_H */
/*
+ * $Id: ddp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*
unsigned dub_hops:4;
unsigned dub_len:10;
unsigned dub_sum:16;
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned dub_sum:16;
unsigned dub_len:10;
unsigned dub_hops:4;
unsigned dub_pad:2;
-#else
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
OOPS!
-#endif
-#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+#endif /* BYTE_ORDER == BIG_ENDIAN */
} du_bits;
unsigned du_bytes;
} deh_u;
unsigned dub_len:10;
unsigned dub_dport:8;
unsigned dub_sport:8;
-#endif
+#endif /* BYTE_ORDER == BIG_ENDIAN */
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned dub_sport:8;
unsigned dub_dport:8;
unsigned dub_len:10;
unsigned dub_pad:6;
-#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
} du_bits;
unsigned du_bytes;
} dsh_u;
/*
+ * $Id: ddp_input.c,v 1.2 2001-06-29 14:14:47 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 /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/mbuf.h>
#include <net/route.h>
#ifdef _IBMR2
#include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
#include "at.h"
#include "at_var.h"
for (;;) {
#ifndef _IBMR2
s = splimp();
-#endif _IBMR2
+#endif /* ! _IBMR2 */
#ifdef BSD4_4
IF_DEQUEUE( &atintrq2, m );
-#else BSD4_4
+#else /* BSD4_4 */
IF_DEQUEUEIF( &atintrq2, m, ifp );
-#endif BSD4_4
+#endif /* BSD4_4 */
#ifndef _IBMR2
splx( s );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
if ( m == 0 ) { /* no more queued packets */
break;
#ifdef BSD4_4
ifp = m->m_pkthdr.rcvif;
-#endif BSD4_4
+#endif /* BSD4_4 */
for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 )) {
break;
for (;;) {
#ifndef _IBMR2
s = splimp();
-#endif _IBMR2
+#endif /* ! _IBMR2 */
#ifdef BSD4_4
IF_DEQUEUE( &atintrq1, m );
-#else BSD4_4
+#else /* BSD4_4 */
IF_DEQUEUEIF( &atintrq1, m, ifp );
-#endif BSD4_4
+#endif /* BSD4_4 */
#ifndef _IBMR2
splx( s );
-#endif _IBMR2
+#endif /* ! _IBMR2 */
if ( m == 0 ) { /* no more queued packets */
break;
#ifdef BSD4_4
ifp = m->m_pkthdr.rcvif;
-#endif BSD4_4
+#endif /* BSD4_4 */
for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
if ( aa->aa_ifp == ifp && ( aa->aa_flags & AFA_PHASE2 ) == 0 ) {
break;
struct ddpehdr *deh, ddpe;
#ifndef BSD4_4
struct mbuf *mp;
-#endif BSD4_4
+#endif /* BSD4_4 */
struct ddpcb *ddp;
int dlen, mlen;
u_short cksum;
*/
#ifdef BSD4_4
mlen = m->m_pkthdr.len;
-#else BSD4_4
+#else /* BSD4_4 */
for ( mlen = 0, mp = m; mp; mp = mp->m_next ) {
mlen += mp->m_len;
}
-#endif BSD4_4
+#endif /* BSD4_4 */
if ( mlen < dlen ) {
ddpstat.ddps_toosmall++;
m_freem( m );
to.sat_addr.s_node )) {
#ifdef ultrix
rtfree( forwro.ro_rt );
-#else ultrix
+#else /* ultrix */
RTFREE( forwro.ro_rt );
-#endif ultrix
+#endif /* ultrix */
forwro.ro_rt = (struct rtentry *)0;
}
if ( forwro.ro_rt == (struct rtentry *)0 ||
forwro.ro_rt->rt_ifp == (struct ifnet *)0 ) {
#ifdef BSD4_4
forwro.ro_dst.sa_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
forwro.ro_dst.sa_family = AF_APPLETALK;
satosat( &forwro.ro_dst )->sat_addr.s_net = to.sat_addr.s_net;
satosat( &forwro.ro_dst )->sat_addr.s_node = to.sat_addr.s_node;
#ifdef BSD4_4
from.sat_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
from.sat_family = AF_APPLETALK;
if ( elh ) {
/*
+ * $Id: ddp_output.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/mbuf.h>
#ifndef BSD4_4
struct mbuf *m0;
int len;
-#endif BSD4_4
+#endif /* ! BSD4_4 */
struct ifnet *ifp;
struct at_ifaddr *aa = NULL;
struct ddpehdr *deh;
#ifdef BSD4_4
M_PREPEND( m, sizeof( struct ddpehdr ), M_WAIT );
-#else BSD4_4
+#else /* BSD4_4 */
for ( len = 0, m0 = m; m; m = m->m_next ) {
len += m->m_len;
}
return( ENOBUFS );
}
m->m_next = m0;
-#endif BSD4_4
+#endif /* BSD4_4 */
#ifndef BSD4_4
# define align(a) (((a)+3)&0xfc)
m->m_off = MMINOFF + align( SZ_ELAPHDR );
m->m_len = sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* ! BSD4_4 */
deh = mtod( m, struct ddpehdr *);
deh->deh_pad = 0;
#ifdef BSD4_4
deh->deh_len = m->m_pkthdr.len;
-#else BSD4_4
+#else /* BSD4_4 */
deh->deh_len = len + sizeof( struct ddpehdr );
-#endif BSD4_4
+#endif /* BSD4_4 */
deh->deh_dnet = ddp->ddp_fsat.sat_addr.s_net;
deh->deh_dnode = ddp->ddp_fsat.sat_addr.s_node;
if ( ro->ro_rt && ( ifp = ro->ro_rt->rt_ifp )) {
#ifdef BSD4_4
net = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#else BSD4_4
+#else /* BSD4_4 */
net = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_net;
-#endif BSD4_4
+#endif /* BSD4_4 */
for ( aa = at_ifaddr; aa; aa = aa->aa_next ) {
if ( aa->aa_ifp == ifp &&
ntohs( net ) >= ntohs( aa->aa_firstnet ) &&
if ( m == NULL ) {
return( ENOBUFS );
}
-#else BSD4_4
+#else /* BSD4_4 */
m->m_off -= SZ_ELAPHDR;
m->m_len += SZ_ELAPHDR;
-#endif BSD4_4
-# endif notdef
+#endif /* BSD4_4 */
+# endif /* notdef */
MGET( m0, M_WAIT, MT_HEADER );
if ( m0 == 0 ) {
} else {
#ifdef BSD4_4
elh->el_dnode = satosat( ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#else BSD4_4
+#else /* BSD4_4 */
elh->el_dnode = satosat( &ro->ro_rt->rt_gateway )->sat_addr.s_node;
-#endif BSD4_4
+#endif /* BSD4_4 */
}
}
} else {
#ifdef BSD4_4
gate = *satosat( ro->ro_rt->rt_gateway );
-#else BSD4_4
+#else /* BSD4_4 */
gate = *satosat( &ro->ro_rt->rt_gateway );
-#endif BSD4_4
+#endif /* BSD4_4 */
}
ro->ro_rt->rt_use++;
#ifdef notdef
m->m_off += SZ_ELAPHDR;
m->m_len -= SZ_ELAPHDR;
-#endif notdef
+#endif /* notdef */
ddp_input( m, ifp, (struct elaphdr *)NULL, 2 );
return( 0 );
}
-#endif ultrix
+#endif /* ultrix */
#ifdef _IBMR2
/*
bcopy( &eh, (*(struct sockaddr *)&gate).sa_data,
sizeof( (*(struct sockaddr *)&gate).sa_data ));
}
-#endif _IBMR2
+#endif /* _IBMR2 */
return((*ifp->if_output)( ifp, m, &gate ));
}
/*
+ * $Id: ddp_usrreq.c,v 1.2 2001-06-29 14:14:47 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 /* HAVE_CONFIG_H */
+
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#ifdef ibm032
#include <sys/dir.h>
-#endif ibm032
+#endif /* ibm032 */
#include <sys/user.h>
#include <sys/mbuf.h>
#include <sys/ioctl.h>
#include <net/route.h>
#ifdef _IBMR2
#include <net/spl.h>
-#endif _IBMR2
+#endif /* _IBMR2 */
#include "at.h"
#include "at_var.h"
suser( u.u_cred, &u.u_acflag )) {
return( EACCES );
}
-#else BSD4_4
+#else /* BSD4_4 */
if ( sat->sat_port < ATPORT_RESERVED && ( !suser())) {
return( EACCES );
}
-#endif BSD4_4
+#endif /* BSD4_4 */
}
} else {
bzero( (caddr_t)&lsat, sizeof( struct sockaddr_at ));
sat->sat_addr.s_node )) {
#ifdef ultrix
rtfree( ro->ro_rt );
-#else ultrix
+#else /* ultrix */
RTFREE( ro->ro_rt );
-#endif ultrix
+#endif /* ultrix */
ro->ro_rt = (struct rtentry *)0;
}
}
ro->ro_rt->rt_ifp == (struct ifnet *)0 ) {
#ifdef BSD4_4
ro->ro_dst.sa_len = sizeof( struct sockaddr_at );
-#endif BSD4_4
+#endif /* BSD4_4 */
ro->ro_dst.sa_family = AF_APPLETALK;
if ( hintnet != 0 ) {
satosat( &ro->ro_dst )->sat_addr.s_net = hintnet;
/*
+ * $Id: ddp_var.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
struct ddpcb *ddpcb;
struct ddpstat ddpstat;
struct ddpcb *ddp_search();
-#endif
+#endif /* KERNEL */
#endif /* netatalk/ddp_var.h */
/*
+ * $Id: endian.h,v 1.4 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*
* This file handles both byte ordering and integer sizes.
*/
-# ifndef _ATALK_ENDIAN_H_
+#ifndef _ATALK_ENDIAN_H_
#define _ATALK_ENDIAN_H_
-#include <sys/types.h>
-#include <netinet/in.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#include <netinet/in.h>
#ifdef _IBMR2
#include <sys/machine.h>
#ifdef sun
#ifdef BSD4_3
#include <sys/bitypes.h>
-#else
+#else /* BSD4_3 */
/* solaris and sunos don't consistently define u_int*_t. */
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef int int32_t;
-#endif
+#endif /* BSD4_3 */
typedef unsigned long long u_int64_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef int int32_t;
-#endif
+#endif /* ultrix || HAVE_32BIT_LONGS || HAVE_64BIT_LONGS */
#ifdef ultrix
typedef int ssize_t;
-#endif
+#endif /* ultrix */
#ifdef HAVE_64BIT_LONGS
typedef unsigned long u_int64_t;
-#else
+#else /* HAVE_64BIT_LONGS */
/* check for long long support. currently, i assume that if 64-bit
* ints exist that their made available via long long */
#ifdef linux
#include <endian.h> /* i think this is here for libc4 */
-#else
+#else /* linux */
#if defined(HAVE_32BIT_LONGS) && !(defined(BSD4_4) || \
defined(NO_LARGE_VOL_SUPPORT))
typedef unsigned long long u_int64_t;
-#endif
+#endif /* HAVE_32BIT_LONGS || !BSD4_4 || NO_LARGE_VOL_SUPPORT */
#endif /* linux */
#endif /* HAVE_64BIT_LONGS */
#endif /* sun */
#ifdef sun
#if defined(i386) || defined(_LITTLE_ENDIAN)
#define BYTE_ORDER LITTLE_ENDIAN
-#else /*i386*/
+#else /* i386 || _LITTLE_ENDIAN */
#define BYTE_ORDER BIG_ENDIAN
-#endif /*i386*/
-#else
+#endif /* i386 || _LITTLE_ENDIAN */
+#else /* sun */
#if defined(MIPSEB) || defined(__hppa)
#define BYTE_ORDER BIG_ENDIAN
-#else
+#else /* MIPSEB || __hppa */
#ifdef MIPSEL
#define BYTE_ORDER LITTLE_ENDIAN
-#else
+#else /* MIPSEL */
#error Like, what is your byte order, man?
-#endif /*MIPSEL*/
-#endif /*MIPSEB*/
-#endif /*sun*/
-# endif /*BYTE_ORDER*/
+#endif /* MIPSEL*/
+#endif /* MIPSEB || __hppa */
+#endif /* sun */
+# endif /* BYTE_ORDER */
# ifndef ntohl
# if defined( sun ) || defined( ultrix ) || defined( _IBMR2 )
#define htonl(x) (x)
#define htons(x) (x)
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
#if defined( mips ) && defined( KERNEL )
#define ntohl(x) nuxi_l(x)
#define ntohs(x) nuxi_s(x)
#define htonl(x) nuxi_l(x)
#define htons(x) nuxi_s(x)
-#else /*mips KERNEL*/
+#else /* mips && KERNEL */
#if !( defined( sun ) && defined( i386 ))
unsigned short ntohs(), htons();
unsigned int ntohl(), htonl();
-#endif
+#endif /* ! ( sun && i386 ) */
-#endif /*mips KERNEL*/
-#endif /*BYTE_ORDER*/
-# endif /*sun ultrix _IBMR2*/
-# endif /*ntohl*/
+#endif /* mips && KERNEL */
+#endif /* BYTE_ORDER */
+# endif /* sun ultrix _IBMR2 */
+# endif /* ntohl */
-# endif /*_ATALK_ENDIAN_H_*/
+#endif /* _ATALK_ENDIAN_H_ */
/*
+ * $Id: phase2.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*/
# if defined( ultrix ) || defined( BSD4_4 )
#include <net/if_llc.h>
-# else ultrix BSD4_4
+# else /* ultrix || BSD4_4 */
#if defined( sun ) && !defined( __svr4__ )
#include <net/if_ieee802.h>
-#endif sun __svr4__
+#endif /* sun && !__svr4__ */
/*
* Copyright (c) 1988 Regents of the University of California.
#define LLC_ISO_LSAP 0xfe
#define LLC_SNAP_LSAP 0xaa
-# endif ultrix BSD4_4
+# endif /* ultrix && BSD4_4 */
#if defined( sun ) || defined( ibm032 )
#define SIOCPHASE1 _IOW(i, 100, struct ifreq) /* AppleTalk phase 1 */
#define SIOCPHASE2 _IOW(i, 101, struct ifreq) /* AppleTalk phase 2 */
-#endif sun ibm032
+#endif /* sun || ibm032 */
#if defined( ultrix ) || defined( BSD4_4 ) || defined( _IBMR2 )
#define SIOCPHASE1 _IOW('i', 100, struct ifreq) /* AppleTalk phase 1 */
#define SIOCPHASE2 _IOW('i', 101, struct ifreq) /* AppleTalk phase 2 */
-#endif ultrix BSD4_4 _IBMR2
+#endif /* ultrix || BSD4_4 || _IBMR2 */
+/*
+ * $Id: aarp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/byteorder.h>
+/*
+ * $Id: ddp.c,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/cmn_err.h>