From owner-freebsd-ipfw Tue Mar 6 11:12:34 2001 Delivered-To: freebsd-ipfw@freebsd.org Received: from excalibur.dotcom.fr (ns.dotcom.fr [195.154.74.11]) by hub.freebsd.org (Postfix) with ESMTP id 16A0637B71A for ; Tue, 6 Mar 2001 11:12:28 -0800 (PST) (envelope-from roman@IPricot.com) Received: from IPricot.com (pc181.fr.ipricot.com [192.168.31.181]) by excalibur.dotcom.fr (8.9.1/8.9.1) with ESMTP id TAA06758 for ; Tue, 6 Mar 2001 19:12:24 GMT X-To: Message-ID: <3AA53697.4B12517@IPricot.com> Date: Tue, 06 Mar 2001 20:12:23 +0100 From: Roman Le Houelleur Organization: dotcom X-Mailer: Mozilla 4.75 [en] (X11; U; FreeBSD 4.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-ipfw Subject: getsockopt Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, I would like to get some information about a specific rule I made from a user program. But the getsockopt () syscall always returns information concerning the very first rule of the chain, not the one I want. here is the (too simple ?) code I use: struct ip_fw rule; int len; bzero (&rule, sizeof (struct ip_fw)); rule.fw_number = MY_RULE_NBR; len = sizeof (rule); if (getsockopt (env->raw_sd, IPPROTO_IP, IP_FW_GET, &rule, &len) == -1) { perror ("getsockopt (IP_FW_GET)"); return -1; } I could not find precise information in the man page (ipfw 4) and don't have much time to check the source code in details. Though it seems to me IP_FW_GET is made to return the entire rule chain... thanks for any explanation, Roman. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message