From owner-freebsd-net Tue Aug 6 4:25:47 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AB9A37B400 for ; Tue, 6 Aug 2002 04:25:42 -0700 (PDT) Received: from hotmail.com (f268.law9.hotmail.com [64.4.8.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64E4F43E6E for ; Tue, 6 Aug 2002 04:25:42 -0700 (PDT) (envelope-from soheil_h_y@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 6 Aug 2002 04:25:42 -0700 Received: from 62.217.112.191 by lw9fd.law9.hotmail.msn.com with HTTP; Tue, 06 Aug 2002 11:25:42 GMT X-Originating-IP: [62.217.112.191] From: "soheil h" To: freebsd-net@FreeBSD.ORG Date: Tue, 06 Aug 2002 15:55:42 +0430 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 06 Aug 2002 11:25:42.0363 (UTC) FILETIME=[FFCAA2B0:01C23D3B] Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi list which of these cast is true for accessing the tcphdr outof the 'struct mbuf' in the ip_input function of ip_input.c ? struct mbuf m; struct ip * ip = mtod(m, ip); int iphlen; struct tcpShdr* th; /* it is a copy of the tcphdr struct i made the definition is type at the bottom*/ hlen = IP_VHL_HL(ip->ip_vhl) < 2; 1. th = (struct tcpShdr *)(ip + 1); 2. th = (struct tcpShdr *)((caddr_t)ip + hlen); PLEASE HELP ME I THINK THE SECOND ONE IS TRUE BUT IT DOESN' Work . struct tcpShdr { u_short th_sport; /* source port */ u_short th_dport; /* destination port */ tcpS_seq th_seq; /* sequence number */ tcpS_seq th_ack; /* acknowledgement number */ u_short th_soheil; u_short th_win; /* window */ u_short th_sum; /* checksum */ u_short th_urp; /* urgent pointer */ }; _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message