print-mobile.c (190207) | print-mobile.c (235530) |
---|---|
1/* $NetBSD: print-mobile.c,v 1.2 1998/09/30 08:57:01 hwr Exp $ */ 2 3/* 4 * (c) 1998 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Heiko W.Rupp <hwr@pilhuhn.de> --- 58 unchanged lines hidden (view full) --- 67/* 68 * Deencapsulate and print a mobile-tunneled IP datagram 69 */ 70void 71mobile_print(const u_char *bp, u_int length) 72{ 73 const u_char *cp = bp +8 ; 74 const struct mobile_ip *mob; | 1/* $NetBSD: print-mobile.c,v 1.2 1998/09/30 08:57:01 hwr Exp $ */ 2 3/* 4 * (c) 1998 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Heiko W.Rupp <hwr@pilhuhn.de> --- 58 unchanged lines hidden (view full) --- 67/* 68 * Deencapsulate and print a mobile-tunneled IP datagram 69 */ 70void 71mobile_print(const u_char *bp, u_int length) 72{ 73 const u_char *cp = bp +8 ; 74 const struct mobile_ip *mob; |
75 struct cksum_vec vec[1]; |
|
75 u_short proto,crc; 76 u_char osp =0; /* old source address present */ 77 78 mob = (const struct mobile_ip *)bp; 79 80 if (length < MOBILE_SIZE || !TTEST(*mob)) { 81 fputs("[|mobile]", stdout); 82 return; --- 13 unchanged lines hidden (view full) --- 96 (void)printf("%s ",ipaddr_string(&mob->osrc)); 97 } else { 98 fputs("[] ",stdout); 99 } 100 if (vflag) { 101 (void)printf("> %s ",ipaddr_string(&mob->odst)); 102 (void)printf("(oproto=%d)",proto>>8); 103 } | 76 u_short proto,crc; 77 u_char osp =0; /* old source address present */ 78 79 mob = (const struct mobile_ip *)bp; 80 81 if (length < MOBILE_SIZE || !TTEST(*mob)) { 82 fputs("[|mobile]", stdout); 83 return; --- 13 unchanged lines hidden (view full) --- 97 (void)printf("%s ",ipaddr_string(&mob->osrc)); 98 } else { 99 fputs("[] ",stdout); 100 } 101 if (vflag) { 102 (void)printf("> %s ",ipaddr_string(&mob->odst)); 103 (void)printf("(oproto=%d)",proto>>8); 104 } |
104 if (in_cksum((u_short *)mob, osp ? 12 : 8, 0)!=0) { | 105 vec[0].ptr = (const u_int8_t *)(void *)mob; 106 vec[0].len = osp ? 12 : 8; 107 if (in_cksum(vec, 1)!=0) { |
105 (void)printf(" (bad checksum %d)",crc); 106 } 107 108 return; 109} | 108 (void)printf(" (bad checksum %d)",crc); 109 } 110 111 return; 112} |