Deleted Added
full compact
alias_nbt.c (65281) alias_nbt.c (74778)
1/*
2 * Written by Atsushi Murai <amurai@spec.co.jp>
3 *
4 * Copyright (C) 1998, System Planning and Engineering Co. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the System Planning and Engineering Co. The name of the
12 * SPEC may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
1/*
2 * Written by Atsushi Murai <amurai@spec.co.jp>
3 *
4 * Copyright (C) 1998, System Planning and Engineering Co. All rights reserverd.
5 *
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms and that any documentation,
9 * advertising materials, and other materials related to such
10 * distribution and use acknowledge that the software was developed
11 * by the System Planning and Engineering Co. The name of the
12 * SPEC may not be used to endorse or promote products derived
13 * from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * $FreeBSD: head/sys/netinet/libalias/alias_nbt.c 65281 2000-08-31 12:54:55Z ru $
18 * $FreeBSD: head/sys/netinet/libalias/alias_nbt.c 74778 2001-03-25 12:05:10Z brian $
19 *
20 * TODO:
21 * oClean up.
22 * oConsidering for word alignment for other platform.
23 */
24/*
25 alias_nbt.c performs special processing for NetBios over TCP/IP
26 sessions by UDP.

--- 209 unchanged lines hidden (view full) ---

236 acc = ndh->source_port;
237 acc -= alias_port;
238 sptr = (u_short *) &(ndh->source_ip);
239 acc += *sptr++;
240 acc += *sptr;
241 sptr = (u_short *) alias_address;
242 acc -= *sptr++;
243 acc -= *sptr;
19 *
20 * TODO:
21 * oClean up.
22 * oConsidering for word alignment for other platform.
23 */
24/*
25 alias_nbt.c performs special processing for NetBios over TCP/IP
26 sessions by UDP.

--- 209 unchanged lines hidden (view full) ---

236 acc = ndh->source_port;
237 acc -= alias_port;
238 sptr = (u_short *) &(ndh->source_ip);
239 acc += *sptr++;
240 acc += *sptr;
241 sptr = (u_short *) alias_address;
242 acc -= *sptr++;
243 acc -= *sptr;
244 ADJUST_CHECKSUM(acc, uh->uh_sum)
244 ADJUST_CHECKSUM(acc, uh->uh_sum);
245 }
246 ndh->source_ip = *alias_address;
247 ndh->source_port = alias_port;
248#ifdef DEBUG
249 printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
250 fflush(stdout);
251#endif
252 return((p == NULL) ? -1 : 0);

--- 100 unchanged lines hidden (view full) ---

353 u_short *sptr;
354
355 sptr = (u_short *) &(nb->addr);
356 acc = *sptr++;
357 acc += *sptr;
358 sptr = (u_short *) &(nbtarg->newaddr);
359 acc -= *sptr++;
360 acc -= *sptr;
245 }
246 ndh->source_ip = *alias_address;
247 ndh->source_port = alias_port;
248#ifdef DEBUG
249 printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
250 fflush(stdout);
251#endif
252 return((p == NULL) ? -1 : 0);

--- 100 unchanged lines hidden (view full) ---

353 u_short *sptr;
354
355 sptr = (u_short *) &(nb->addr);
356 acc = *sptr++;
357 acc += *sptr;
358 sptr = (u_short *) &(nbtarg->newaddr);
359 acc -= *sptr++;
360 acc -= *sptr;
361 ADJUST_CHECKSUM(acc, *nbtarg->uh_sum)
361 ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
362 }
363
364 nb->addr = nbtarg->newaddr;
365#ifdef DEBUG
366 printf("O");
367#endif
368 }
369#ifdef DEBUG

--- 51 unchanged lines hidden (view full) ---

421 u_short *sptr;
422
423 sptr = (u_short *) &(a->addr); /* Old */
424 acc = *sptr++;
425 acc += *sptr;
426 sptr = (u_short *) &nbtarg->newaddr; /* New */
427 acc -= *sptr++;
428 acc -= *sptr;
362 }
363
364 nb->addr = nbtarg->newaddr;
365#ifdef DEBUG
366 printf("O");
367#endif
368 }
369#ifdef DEBUG

--- 51 unchanged lines hidden (view full) ---

421 u_short *sptr;
422
423 sptr = (u_short *) &(a->addr); /* Old */
424 acc = *sptr++;
425 acc += *sptr;
426 sptr = (u_short *) &nbtarg->newaddr; /* New */
427 acc -= *sptr++;
428 acc -= *sptr;
429 ADJUST_CHECKSUM(acc, *nbtarg->uh_sum)
429 ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
430 }
431
432 a->addr = nbtarg->newaddr;
433 }
434 a++; /*XXXX*/
435 bcount -= SizeOfResourceA;
436 }
437 if (a == NULL || (char *)(a + 1) > pmax)

--- 257 unchanged lines hidden ---
430 }
431
432 a->addr = nbtarg->newaddr;
433 }
434 a++; /*XXXX*/
435 bcount -= SizeOfResourceA;
436 }
437 if (a == NULL || (char *)(a + 1) > pmax)

--- 257 unchanged lines hidden ---