]> git.pld-linux.org Git - packages/dip.git/blob - dip-3.3.7o-misc.patch
- additional patches for package dip
[packages/dip.git] / dip-3.3.7o-misc.patch
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
3 @@ -5,6 +5,7 @@
4   *
5   * Portability nits fixed and reformatted - 2/12/91 Phil Karn
6   */
7 +#include <sys/types.h>
8  
9  /* 
10   * To use MD4:
11 @@ -38,7 +39,7 @@
12  #define FALSE 0
13  
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
20 @@ -87,7 +88,7 @@
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)
23  
24 -void MDreverse __ARGS((unsigned long *X));
25 +void MDreverse __ARGS((__u32 *X));
26  
27  /* MDprint(MDp)
28   * Print message digest buffer MDp as 32 hexadecimal digits.
29 @@ -134,9 +135,9 @@
30                *X++ = ((t & 0xFF00FF00) >> 8) | ((t & 0x00FF00FF) << 8); }
31  void
32  MDreverse(X)
33 -unsigned long *X;
34 +__u32 *X;
35  {
36 -       register unsigned long t;
37 +       register __u32 t;
38  
39         revx;
40         revx;
41 @@ -165,9 +166,9 @@
42  static void
43  MDblock(MDp,X)
44  MDptr MDp;
45 -unsigned long *X;
46 +__u32 *X;
47  { 
48 -       register unsigned long tmp, A, B, C, D;
49 +       register __u32 tmp, A, B, C, D;
50  
51  #if LOWBYTEFIRST == FALSE
52         MDreverse(X);
53 @@ -251,7 +252,7 @@
54  unsigned int count;
55  {
56         int i,bit,byte,mask;
57 -       unsigned long tmp;
58 +       __u32 tmp;
59         unsigned char XX[64];
60         unsigned char *p;
61  
62 @@ -276,7 +277,7 @@
63         /* Process data */
64         if(count == 512){
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);
71 @@ -299,15 +300,15 @@
72                 if(byte <= 55){
73                         for(i=0;i<8;i++)
74                                 XX[56+i] = MDp->count[i];
75 -                       MDblock(MDp,(unsigned long *)XX);
76 +                       MDblock(MDp,(__u32 *)XX);
77                 } else {
78                         /* need to do two blocks to finish up */
79 -                       MDblock(MDp,(unsigned long *)XX);
80 +                       MDblock(MDp,(__u32 *)XX);
81                         for(i=0;i<56;i++)
82                                 XX[i] = 0;
83                         for(i=0;i<8;i++)
84                                 XX[56+i] = MDp->count[i];
85 -                       MDblock(MDp,(unsigned long *)XX);
86 +                       MDblock(MDp,(__u32 *)XX);
87                 }
88         /* Set flag saying we're done with MD computation */
89         MDp->done = 1;
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
92 @@ -13,9 +13,10 @@
93  #include <string.h>
94  #include <assert.h>
95  #include <ctype.h>
96 +#include <sys/types.h>
97  #include "skey.h"
98  
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 @@
105    unsigned char cl;
106    unsigned char cc;
107    unsigned char cr;
108 -  unsigned long y;
109 +  __u32 y;
110    int shift;
111  
112    assert (length <= 11);
113 @@ -2295,7 +2296,7 @@
114  }
115  
116  /* Extract 'length' bits from the char array 's' starting with bit 'start' */
117 -static unsigned long
118 +static __u32
119   extract (s, start, length)
120    char *s;
121    int start, length;
122 @@ -2303,7 +2304,7 @@
123    unsigned char cl;
124    unsigned char cc;
125    unsigned char cr;
126 -  unsigned long x;
127 +  __u32 x;
128  
129    assert (length <= 11);
130    assert (start >= 0);
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
133 @@ -13,8 +13,10 @@
134  #include <string.h>
135  #include <pwd.h>
136  #ifdef linux
137 -#undef SHADOW
138 -#include <shadow.h>
139 +# ifndef __alpha__
140 +#  undef SHADOW
141 +#  include <shadow.h>
142 +# endif
143  #endif
144  #include <sys/resource.h>
145  #include <time.h>
146 @@ -141,7 +143,7 @@
147    switch (rval)
148    {
149    case -1:
150 -    perror ("Error opening database: ");
151 +    perror ("Error opening database");
152      exit (1);
153    case 0:
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
157 @@ -352,7 +352,7 @@
158    char *username;
159  {
160    int i;
161 -  char str [50];
162 +  static char str [50];
163   
164    struct skey skey;
165   
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
168 @@ -11,6 +11,7 @@
169   * S/KEY misc routines.
170   */
171  
172 +#include <malloc.h>
173  #include <stdio.h>
174  
175  #ifdef HAS_STD_LIB
176 @@ -86,7 +87,7 @@
177         unsigned int buflen;
178  #ifndef        LITTLE_ENDIAN
179         int i;
180 -       register long tmp;
181 +       register __u32 tmp;
182  #endif
183         
184         buflen = strlen(seed) + strlen(passwd);
185 @@ -134,7 +135,7 @@
186  {
187         MDstruct md;
188  #ifndef        LITTLE_ENDIAN
189 -       register long tmp;
190 +       __u32 tmp;
191  #endif
192  
193         MDbegin(&md);
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 @@
197  int s;
198  time_t online;
199  
200 -static u_long proxy_arp = 0;
201 +static __u32 proxy_arp = 0;
202  
203  /*
204   * Make a string representation of a network IP address.
205   */
206  inline static char *
207  ip_ntoa(ipaddr)
208 -u_long ipaddr;
209 +__u32 ipaddr;
210  {
211      static char b[64];
212  
213 @@ -166,9 +166,9 @@
214  }
215  
216  static 
217 -int get_ether_addr (u_long ipaddr, struct sockaddr *hwaddr)
218 +int get_ether_addr (__u32 ipaddr, struct sockaddr *hwaddr)
219  {
220 -    u_long ina, mask;
221 +    __u32 ina, mask;
222      struct ifreq *ifr, *ifend;
223  #if 0
224      struct sockaddr_dl *dla;
225 @@ -266,8 +266,8 @@
226  
227  static int sifproxyarp (struct dip *dip)
228  {
229 -    u_long his_adr;
230 -    u_long my_adr;
231 +    __u32 his_adr;
232 +    __u32 my_adr;
233      struct arpreq arpreq;
234  
235      memset (&arpreq, '\0', sizeof(arpreq));
236 @@ -417,7 +417,7 @@
237  typedef struct
238  {
239         int acct;
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];
245 @@ -448,7 +448,7 @@
246         while (fgets(buf, 255, f))
247         {  /* read in the data */
248            sscanf(buf,
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],
254 @@ -478,7 +478,9 @@
255    char buff[1024];
256    static int flag = 0;
257    extern int opt_i;
258 +#ifdef CONFIG_IP_ACCT
259    u_long b_in=0, b_out=0, p_in=0, p_out=0;
260 +#endif
261    char  *p;
262    char in_b[10], out_b[10];
263  
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 @@
267    return(0);
268  }
269   
270 -#define int32 unsigned long
271 -#define int16 unsigned short
272 +#define int32 __u32
273 +#define int16 __u16
274  
275  struct bootp {
276         char    op;                     /* packet opcode type */
277 @@ -2225,6 +2225,135 @@
278    }
279  }
280  
281 +#ifdef __alpha__
282 +
283 +/*
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... :)
286 + */
287 +
288 +static inline unsigned short
289 +from64to16(unsigned long x)
290 +{
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);
299 +       return x;
300 +}
301 +
302 +/*
303 + * Do a 64-bit checksum on an arbitrary memory area..
304 + *
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.
308 + */
309 +static inline unsigned long
310 +do_csum(unsigned char * buff, int len)
311 +{
312 +       int odd, count;
313 +       unsigned long result = 0;
314 +
315 +       if (len <= 0)
316 +               goto out;
317 +       odd = 1 & (unsigned long) buff;
318 +       if (odd) {
319 +               result = *buff << 8;
320 +               len--;
321 +               buff++;
322 +       }
323 +       count = len >> 1;               /* nr of 16-bit words.. */
324 +       if (count) {
325 +               if (2 & (unsigned long) buff) {
326 +                       result += *(unsigned short *) buff;
327 +                       count--;
328 +                       len -= 2;
329 +                       buff += 2;
330 +               }
331 +               count >>= 1;            /* nr of 32-bit words.. */
332 +               if (count) {
333 +                       if (4 & (unsigned long) buff) {
334 +                               result += *(unsigned int *) buff;
335 +                               count--;
336 +                               len -= 4;
337 +                               buff += 4;
338 +                       }
339 +                       count >>= 1;    /* nr of 64-bit words.. */
340 +                       if (count) {
341 +                               unsigned long carry = 0;
342 +                               do {
343 +                                       unsigned long w = *(unsigned long *) buff;
344 +                                       count--;
345 +                                       buff += 8;
346 +                                       result += carry;
347 +                                       result += w;
348 +                                       carry = (w > result);
349 +                               } while (count);
350 +                               result += carry;
351 +                               result = (result & 0xffffffff) + (result >> 32);
352 +                       }
353 +                       if (len & 4) {
354 +                               result += *(unsigned int *) buff;
355 +                               buff += 4;
356 +                       }
357 +               }
358 +               if (len & 2) {
359 +                       result += *(unsigned short *) buff;
360 +                       buff += 2;
361 +               }
362 +       }
363 +       if (len & 1)
364 +               result += *buff;
365 +       result = from64to16(result);
366 +       if (odd)
367 +               result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
368 +out:
369 +       return result;
370 +}
371 +
372 +
373 +/*
374 + *     This is a version of ip_compute_csum() optimized for IP headers,
375 + *     which always checksum on 4 octet boundaries.
376 + */
377 +unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
378 +{
379 +       return ~do_csum(iph,ihl*4);
380 +}
381 +
382 +/*
383 + * computes the checksum of the TCP/UDP pseudo-header
384 + * returns a 16-bit checksum, already complemented.
385 + */
386 +unsigned short int csum_tcpudp_magic(unsigned long saddr,
387 +                                  unsigned long daddr,
388 +                                  unsigned short len,
389 +                                  unsigned short proto,
390 +                                  unsigned int sum)
391 +{
392 +       return ~from64to16(saddr + daddr + sum +
393 +               ((unsigned long) ntohs(len) << 16) +
394 +               ((unsigned long) proto << 8));
395 +}
396 +
397 +
398 +static unsigned short
399 +udp_check(struct udphdr *uh, int len,
400 +         unsigned long saddr, unsigned long daddr)
401 +{
402 +       return(csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, 0));
403 +}
404 +
405 +
406 +
407 +#else /* !__alpha__ */
408 +
409 +
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);
416  }
417 +
418 +#endif /* !__alpha__ */
419  
420  static void put_bootreq(void)
421  {
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
424 @@ -43,11 +43,10 @@
425  #include <arpa/inet.h>
426  #include <arpa/nameser.h>
427  #include <netinet/in.h>
428 +#include <net/if_arp.h>
429  #include <netdb.h>
430  #include <resolv.h>
431  #include <net/if_arp.h>
432 -
433 -#include <linux/autoconf.h>
434  
435  #include "pathnames.h"
436  
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
439 @@ -45,8 +45,7 @@
440  #SNKLIB=
441  
442  SKEYDEF        = -DSKEY
443 -#SKEYLIB       = -L. -L./skey -L/usr/local/lib -lskey
444 -SKEYLIB        = -lskey
445 +SKEYLIB        = -L. -L./skey -lskey
446  
447  CC     = gcc
448  
This page took 0.086667 seconds and 3 git commands to generate.