1 --- dip-3.3.7o/skey/md4.c.misc Wed Jun 22 19:53:50 1994
2 +++ dip-3.3.7o/skey/md4.c Thu Jan 21 15:48:47 1999
5 * Portability nits fixed and reformatted - 2/12/91 Phil Karn
7 +#include <sys/types.h>
14 #if (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \
15 - || defined(vax) || defined (MIPSEL))
16 + || defined(vax) || defined (MIPSEL) || defined(__alpha__))
17 #define LOWBYTEFIRST TRUE /* Low order bytes are first in memory */
18 #else /* Almost all other machines are big-endian */
19 #define LOWBYTEFIRST FALSE
21 #define gg(A,B,C,D,i,s) A = rot((A + g(B,C,D) + X[i] + C2),s)
22 #define hh(A,B,C,D,i,s) A = rot((A + h(B,C,D) + X[i] + C3),s)
24 -void MDreverse __ARGS((unsigned long *X));
25 +void MDreverse __ARGS((__u32 *X));
28 * Print message digest buffer MDp as 32 hexadecimal digits.
30 *X++ = ((t & 0xFF00FF00) >> 8) | ((t & 0x00FF00FF) << 8); }
36 - register unsigned long t;
48 - register unsigned long tmp, A, B, C, D;
49 + register __u32 tmp, A, B, C, D;
51 #if LOWBYTEFIRST == FALSE
65 /* Full block of data to handle */
66 - MDblock(MDp,(unsigned long *)X);
67 + MDblock(MDp,(__u32 *)X);
68 } else if(count > 512){
69 /* Check for count too large */
70 printf("\nError: MDupdate called with illegal count value %ld.",count);
74 XX[56+i] = MDp->count[i];
75 - MDblock(MDp,(unsigned long *)XX);
76 + MDblock(MDp,(__u32 *)XX);
78 /* need to do two blocks to finish up */
79 - MDblock(MDp,(unsigned long *)XX);
80 + MDblock(MDp,(__u32 *)XX);
84 XX[56+i] = MDp->count[i];
85 - MDblock(MDp,(unsigned long *)XX);
86 + MDblock(MDp,(__u32 *)XX);
88 /* Set flag saying we're done with MD computation */
90 --- dip-3.3.7o/skey/put.c.misc Wed Jun 22 19:53:50 1994
91 +++ dip-3.3.7o/skey/put.c Thu Jan 21 15:48:47 1999
96 +#include <sys/types.h>
99 -static unsigned long extract __ARGS ((char *s, int start, int length));
100 +static __u32 extract __ARGS ((char *s, int start, int length));
101 static void standard __ARGS ((char *word));
102 static void insert __ARGS ((char *s, int x, int start, int length));
103 static int wsrch __ARGS ((char *w, int low, int high));
104 @@ -2244,7 +2245,7 @@
112 assert (length <= 11);
113 @@ -2295,7 +2296,7 @@
116 /* Extract 'length' bits from the char array 's' starting with bit 'start' */
117 -static unsigned long
119 extract (s, start, length)
122 @@ -2303,7 +2304,7 @@
129 assert (length <= 11);
131 --- dip-3.3.7o/skey/skeyinit.c.misc Wed Jun 22 19:53:50 1994
132 +++ dip-3.3.7o/skey/skeyinit.c Thu Jan 21 15:48:47 1999
141 +# include <shadow.h>
144 #include <sys/resource.h>
150 - perror ("Error opening database: ");
151 + perror ("Error opening database");
154 printf ("[Updating %s]\n", pp->pw_name);
155 --- dip-3.3.7o/skey/skeylogin.c.misc Wed Jun 22 19:53:50 1994
156 +++ dip-3.3.7o/skey/skeylogin.c Thu Jan 21 15:48:47 1999
162 + static char str [50];
166 --- dip-3.3.7o/skey/skeysubr.c.misc Wed Jun 22 19:53:51 1994
167 +++ dip-3.3.7o/skey/skeysubr.c Thu Jan 21 15:48:47 1999
169 * S/KEY misc routines.
178 #ifndef LITTLE_ENDIAN
181 + register __u32 tmp;
184 buflen = strlen(seed) + strlen(passwd);
188 #ifndef LITTLE_ENDIAN
194 --- dip-3.3.7o/attach.c.misc Mon Sep 18 17:41:06 1995
195 +++ dip-3.3.7o/attach.c Thu Jan 21 15:48:47 1999
196 @@ -144,14 +144,14 @@
200 -static u_long proxy_arp = 0;
201 +static __u32 proxy_arp = 0;
204 * Make a string representation of a network IP address.
217 -int get_ether_addr (u_long ipaddr, struct sockaddr *hwaddr)
218 +int get_ether_addr (__u32 ipaddr, struct sockaddr *hwaddr)
222 struct ifreq *ifr, *ifend;
224 struct sockaddr_dl *dla;
227 static int sifproxyarp (struct dip *dip)
233 struct arpreq arpreq;
235 memset (&arpreq, '\0', sizeof(arpreq));
240 - unsigned long sa, da, sm, dm, iface;
241 + __u32 sa, da, sm, dm, iface;
242 unsigned int nsp, ndp;
243 unsigned long npkt, nbyt;
244 unsigned int fw_pts[10];
246 while (fgets(buf, 255, f))
247 { /* read in the data */
249 - "%lX/%lX->%lX/%lX %lX %X %u %u %lu %lu %u %u %u %u %u %u %u %u %u %u",
250 + "%X/%X->%X/%X %X %X %u %u %lu %lu %u %u %u %u %u %u %u %u %u %u",
251 &rec->sa, &rec->sm, &rec->da, &rec->dm, &rec->iface,
252 &rec->fw_flg, &rec->nsp, &rec->ndp, &rec->npkt, &rec->nbyt,
253 &rec->fw_pts[0], &rec->fw_pts[1], &rec->fw_pts[2], &rec->fw_pts[3],
258 +#ifdef CONFIG_IP_ACCT
259 u_long b_in=0, b_out=0, p_in=0, p_out=0;
262 char in_b[10], out_b[10];
264 --- dip-3.3.7o/command.c.misc Mon Feb 12 21:01:16 1996
265 +++ dip-3.3.7o/command.c Thu Jan 21 15:48:47 1999
266 @@ -2174,8 +2174,8 @@
270 -#define int32 unsigned long
271 -#define int16 unsigned short
276 char op; /* packet opcode type */
277 @@ -2225,6 +2225,135 @@
284 + * The following routines come from linux/arch/alpha/lib/checksum.c and
285 + * linux/net/ipv4/udp.c. See, I'm in a hurry to get this working... :)
288 +static inline unsigned short
289 +from64to16(unsigned long x)
291 + /* add up 32-bit words for 33 bits */
292 + x = (x & 0xffffffff) + (x >> 32);
293 + /* add up 16-bit and 17-bit words for 17+c bits */
294 + x = (x & 0xffff) + (x >> 16);
295 + /* add up 16-bit and 2-bit for 16+c bit */
296 + x = (x & 0xffff) + (x >> 16);
297 + /* add up carry.. */
298 + x = (x & 0xffff) + (x >> 16);
303 + * Do a 64-bit checksum on an arbitrary memory area..
305 + * This isn't a great routine, but it's not _horrible_ either. The
306 + * inner loop could be unrolled a bit further, and there are better
307 + * ways to do the carry, but this is reasonable.
309 +static inline unsigned long
310 +do_csum(unsigned char * buff, int len)
313 + unsigned long result = 0;
317 + odd = 1 & (unsigned long) buff;
319 + result = *buff << 8;
323 + count = len >> 1; /* nr of 16-bit words.. */
325 + if (2 & (unsigned long) buff) {
326 + result += *(unsigned short *) buff;
331 + count >>= 1; /* nr of 32-bit words.. */
333 + if (4 & (unsigned long) buff) {
334 + result += *(unsigned int *) buff;
339 + count >>= 1; /* nr of 64-bit words.. */
341 + unsigned long carry = 0;
343 + unsigned long w = *(unsigned long *) buff;
348 + carry = (w > result);
351 + result = (result & 0xffffffff) + (result >> 32);
354 + result += *(unsigned int *) buff;
359 + result += *(unsigned short *) buff;
365 + result = from64to16(result);
367 + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
374 + * This is a version of ip_compute_csum() optimized for IP headers,
375 + * which always checksum on 4 octet boundaries.
377 +unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
379 + return ~do_csum(iph,ihl*4);
383 + * computes the checksum of the TCP/UDP pseudo-header
384 + * returns a 16-bit checksum, already complemented.
386 +unsigned short int csum_tcpudp_magic(unsigned long saddr,
387 + unsigned long daddr,
388 + unsigned short len,
389 + unsigned short proto,
392 + return ~from64to16(saddr + daddr + sum +
393 + ((unsigned long) ntohs(len) << 16) +
394 + ((unsigned long) proto << 8));
398 +static unsigned short
399 +udp_check(struct udphdr *uh, int len,
400 + unsigned long saddr, unsigned long daddr)
402 + return(csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, 0));
407 +#else /* !__alpha__ */
410 /* This is a version of ip_compute_csum() optimized for IP headers, which
411 always checksum on 4 octet boundaries. */
412 static inline unsigned short
413 @@ -2308,6 +2437,8 @@
414 /* We only want the bottom 16 bits, but we never cleared the top 16. */
415 return((~sum) & 0xffff);
418 +#endif /* !__alpha__ */
420 static void put_bootreq(void)
422 --- dip-3.3.7o/dip.h.misc Wed Sep 6 10:42:50 1995
423 +++ dip-3.3.7o/dip.h Thu Jan 21 15:51:51 1999
425 #include <arpa/inet.h>
426 #include <arpa/nameser.h>
427 #include <netinet/in.h>
428 +#include <net/if_arp.h>
431 #include <net/if_arp.h>
433 -#include <linux/autoconf.h>
435 #include "pathnames.h"
437 --- dip-3.3.7o/Makefile.misc Thu Feb 8 15:06:16 1996
438 +++ dip-3.3.7o/Makefile Thu Jan 21 15:48:47 1999
443 -#SKEYLIB = -L. -L./skey -L/usr/local/lib -lskey
445 +SKEYLIB = -L. -L./skey -lskey