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]; |
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 } |
105 vec[0].ptr = (const u_int8_t *)(void *)mob; 106 vec[0].len = osp ? 12 : 8; 107 if (in_cksum(vec, 1)!=0) { |
108 (void)printf(" (bad checksum %d)",crc); 109 } 110 111 return; 112} |