From owner-freebsd-net@FreeBSD.ORG Mon Sep 1 04:12:15 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A516A106567F for ; Mon, 1 Sep 2008 04:12:15 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id 615B88FC15 for ; Mon, 1 Sep 2008 04:12:15 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=daemon.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ka0ll-000Jyf-3r; Mon, 01 Sep 2008 12:12:01 +0800 Message-ID: <48BB6B95.4010103@micom.mng.net> Date: Mon, 01 Sep 2008 12:12:05 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.12 (X11/20080415) MIME-Version: 1.0 To: "freebsd-net@freebsd.org" X-Enigmail-Version: 0.95.6 OpenPGP: id=78F6425E Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Gleb Smirnoff , rizzo@iet.unipi.it, Julian Elischer Subject: IPFW_TABLES_MAX in src/sbin/ipfw/ipfw2.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 04:12:15 -0000 Hi, Sorry for sending this third time (2 to freebsd-ipfw, 1 to freebsd-net). I'm trying to make small changes in ipfw2.c code (RELENG_7), but make fails with following error: v02# make cc -O2 -fno-strict-aliasing -pipe -Wno-pointer-sign -c /usr/src/sbin/ipfw/ipfw2.c /usr/src/sbin/ipfw/ipfw2.c: In function 'table_handler': /usr/src/sbin/ipfw/ipfw2.c:5941: error: 'IPFW_TABLES_MAX' undeclared (first use in this function) /usr/src/sbin/ipfw/ipfw2.c:5941: error: (Each undeclared identifier is reported only once /usr/src/sbin/ipfw/ipfw2.c:5941: error: for each function it appears in.) *** Error code 1 IPFW_TABLES_MAX seems like defined in netinet/ip_fw.h, which is included in ipfw2.c: #define IPFW_INTERNAL /* Access to protected structures in ip_fw.h. */ ... #include ... I'm trying to read IPFW_TABLES_MAX and print all tables IP in loop. Any idea how to solve this problem? Basically I'm trying to add small feature (list IPs of all tables) to /sbin/ipfw something like: ipfw table all list I know it is possible to write small shell script to display all the tables and IPs in it. However I thought it might be useful to have such small feature in /sbin/ipfw. Correct me if I'm wrong here. thanks, Ganbold -- Understanding is always the understanding of a smaller problem in relation to a bigger problem. -- P. D. Ouspensky