print-isoclns.c (32149) | print-isoclns.c (39300) |
---|---|
1/* 2 * Copyright (c) 1992, 1993, 1994, 1995, 1996 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 9 unchanged lines hidden (view full) --- 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * 21 * Original code by Matt Thomas, Digital Equipment Corporation 22 */ 23 24#ifndef lint 25static const char rcsid[] = | 1/* 2 * Copyright (c) 1992, 1993, 1994, 1995, 1996 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 9 unchanged lines hidden (view full) --- 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * 21 * Original code by Matt Thomas, Digital Equipment Corporation 22 */ 23 24#ifndef lint 25static const char rcsid[] = |
26 "@(#) $Header: print-isoclns.c,v 1.14 96/12/10 23:26:56 leres Exp $ (LBL)"; | 26 "@(#) $Header: print-isoclns.c,v 1.15 96/12/31 21:27:41 leres Exp $ (LBL)"; |
27#endif 28 29#include <sys/types.h> 30#include <sys/time.h> 31#include <sys/socket.h> 32 33#if __STDC__ 34struct mbuf; --- 243 unchanged lines hidden (view full) --- 278 printf(" LI(%d) > PDU size (%d)!", li, length); 279 return; 280 } 281 if (li < sizeof(struct esis_hdr) + 2) { 282 if (qflag) 283 printf(" bad pkt!"); 284 else { 285 printf(" too short for esis header %d:", li); | 27#endif 28 29#include <sys/types.h> 30#include <sys/time.h> 31#include <sys/socket.h> 32 33#if __STDC__ 34struct mbuf; --- 243 unchanged lines hidden (view full) --- 278 printf(" LI(%d) > PDU size (%d)!", li, length); 279 return; 280 } 281 if (li < sizeof(struct esis_hdr) + 2) { 282 if (qflag) 283 printf(" bad pkt!"); 284 else { 285 printf(" too short for esis header %d:", li); |
286 while (--length >= 0) | 286 while (--length != 0) |
287 printf("%02X", *p++); 288 } 289 return; 290 } 291 switch (eh->type & 0x1f) { 292 293 case ESIS_REDIRECT: 294 printf(" redirect"); --- 363 unchanged lines hidden (view full) --- 658static int 659osi_cksum(register const u_char *p, register int len, u_char *off) 660{ 661 int32_t c0 = 0, c1 = 0; 662 663 if ((off[0] == 0) && (off[1] == 0)) 664 return 0; 665 | 287 printf("%02X", *p++); 288 } 289 return; 290 } 291 switch (eh->type & 0x1f) { 292 293 case ESIS_REDIRECT: 294 printf(" redirect"); --- 363 unchanged lines hidden (view full) --- 658static int 659osi_cksum(register const u_char *p, register int len, u_char *off) 660{ 661 int32_t c0 = 0, c1 = 0; 662 663 if ((off[0] == 0) && (off[1] == 0)) 664 return 0; 665 |
666 while (--len >= 0) { | 666 off[0] = off[1] = 0; 667 while ((int)--len >= 0) { |
667 c0 += *p++; 668 c0 %= 255; 669 c1 += c0; 670 c1 %= 255; 671 } 672 return (c0 | c1); 673} | 668 c0 += *p++; 669 c0 %= 255; 670 c1 += c0; 671 c1 %= 255; 672 } 673 return (c0 | c1); 674} |