From owner-freebsd-bugs Wed Jul 21 4:16:48 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from giasbm01.vsnl.net.in (giasbm01.vsnl.net.in [202.54.1.18]) by hub.freebsd.org (Postfix) with ESMTP id E5EC2154AB for ; Wed, 21 Jul 1999 04:16:29 -0700 (PDT) (envelope-from rhtiwari@cygsoft.com) Received: from surya.vyom.com (IDENT:root@PPP113-27.bom.vsnl.net.in [202.54.113.27]) by giasbm01.vsnl.net.in (8.9.2/8.9.2) with ESMTP id QAA17171 for ; Wed, 21 Jul 1999 16:46:14 +0530 (IST) Received: from ratnakar (ratna [10.1.1.62]) by surya.vyom.com (8.8.7/8.6.12) with SMTP id MAA05203 for ; Wed, 21 Jul 1999 12:01:47 +0300 Message-ID: <001101bed342$646fbfa0$3e01010a@ratnakar> From: "Ratnakar Tiwari" To: Subject: Uninitialized function pointer in Network Address Translation code Date: Wed, 21 Jul 1999 11:59:31 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000E_01BED370.7DEC7940" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_000E_01BED370.7DEC7940 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am trying to figure out how Network Address Translation works and I was going through the FreeBSD source code for it.This source code was downloaded from: ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-stable/src/sys/netinet . In file ip_input.c on line 163 a pointer is declared as follows: ip_nat_t *ip_nat_ptr ; ip_nat_t is a function type defined in ip_fw.h as typedef int ip_nat_t __P((struct ip **, struct mbuf **, struct ifnet *, int));=20 __P is a macro defined in ip_compat.h The function pointer ip_nat_ptr is used on line 441 of ip_input.c as: if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN) =20 However I was unable to determine where this pointer is being initialized.=20 Could somebody please explain to me what exactly is going on in the = code? Thanks. Ratnakar ------=_NextPart_000_000E_01BED370.7DEC7940 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
  I am trying to figure = out how=20 Network Address Translation works and I
was going through the FreeBSD = source=20 code for it.This source code was
downloaded=20 from:
 ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-stable/src/sys/netinet= =20 .
 
In file ip_input.c on line 163  = a pointer=20 is declared as follows:
ip_nat_t *ip_nat_ptr ;
 
ip_nat_t is a function type defined = in ip_fw.h=20 as
 
typedef int ip_nat_t __P((struct ip = **, struct=20 mbuf **, struct ifnet *,
int));
 __P is a macro defined in=20 ip_compat.h
 
The function pointer ip_nat_ptr is = used on line=20 441 of ip_input.c as:
 
 if (ip_nat_ptr &&=20 !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif,=20 IP_NAT_IN)
 
However I was unable to determine where this = pointer is=20 being
initialized.
 
Could somebody please explain to me = what exactly=20 is going on in the code?
 
Thanks.
 
Ratnakar
------=_NextPart_000_000E_01BED370.7DEC7940-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message