ca76526b11
if it exists.
78 lines
1.7 KiB
Plaintext
78 lines
1.7 KiB
Plaintext
--- bin/getzones/getzones.c.orig Thu Sep 19 05:07:02 1996
|
|
+++ bin/getzones/getzones.c Wed Nov 10 14:02:35 1999
|
|
@@ -1,14 +1,21 @@
|
|
#include <sys/types.h>
|
|
+#include <sys/param.h>
|
|
#include <sys/uio.h>
|
|
#include <sys/socket.h>
|
|
#include <sys/time.h>
|
|
#include <netdb.h>
|
|
#include <stdio.h>
|
|
+#include <unistd.h>
|
|
+#include <string.h>
|
|
#include <netatalk/endian.h>
|
|
#include <netatalk/at.h>
|
|
#include <atalk/atp.h>
|
|
#include <atalk/zip.h>
|
|
|
|
+void print_zones();
|
|
+int atalk_aton();
|
|
+
|
|
+void
|
|
usage( s )
|
|
char *s;
|
|
{
|
|
@@ -16,6 +23,7 @@
|
|
exit( 1 );
|
|
}
|
|
|
|
+int
|
|
main( argc, argv )
|
|
int argc;
|
|
char *argv[];
|
|
@@ -26,7 +34,7 @@
|
|
struct servent *se;
|
|
char reqdata[4], buf[ ATP_MAXDATA ];
|
|
struct iovec iov;
|
|
- short temp, index = 0;
|
|
+ int16_t temp, index = 0;
|
|
int c, myzoneflg = 0, localzonesflg = 0, errflg = 0;
|
|
extern int optind;
|
|
|
|
@@ -62,7 +70,7 @@
|
|
exit( 1 );
|
|
}
|
|
|
|
- bzero( (char *) &saddr, sizeof( struct sockaddr_at ));
|
|
+ memset( (char *) &saddr, 0, sizeof( struct sockaddr_at ));
|
|
#ifdef BSD4_4
|
|
saddr.sat_len = sizeof( struct sockaddr_at );
|
|
#endif BSD4_4
|
|
@@ -89,7 +97,7 @@
|
|
do {
|
|
atpb.atp_saddr = &saddr;
|
|
temp = htons( index );
|
|
- bcopy( &temp, &reqdata[2], 2 );
|
|
+ memcpy( &reqdata[2], &temp, 2 );
|
|
atpb.atp_sreqdata = reqdata;
|
|
atpb.atp_sreqdlen = 4;
|
|
atpb.atp_sreqto = 2;
|
|
@@ -112,7 +120,7 @@
|
|
exit( 1 );
|
|
}
|
|
|
|
- bcopy( &((char *)iov.iov_base)[2], &temp, 2 );
|
|
+ memcpy( &temp, &((char *)iov.iov_base)[2], 2 );
|
|
temp = ntohs( temp );
|
|
print_zones( temp, iov.iov_base+4 );
|
|
index += temp;
|
|
@@ -126,7 +134,7 @@
|
|
exit( 0 );
|
|
}
|
|
|
|
-
|
|
+void
|
|
print_zones( n, buf )
|
|
short n; /* number of zones in this packet */
|
|
char *buf; /* zone length/name pairs */
|