From owner-freebsd-net@freebsd.org Tue May 3 19:41:15 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC169B2CEBC for ; Tue, 3 May 2016 19:41:15 +0000 (UTC) (envelope-from victor.toni@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 563A01BCD for ; Tue, 3 May 2016 19:41:15 +0000 (UTC) (envelope-from victor.toni@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id u64so34752827lff.3 for ; Tue, 03 May 2016 12:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=gc0kS4FWeyRgh8FzaGJrEEK3oQhvg2mltOYTUWODP9M=; b=XE0BQXhobNGhUFlgOSiL05XI9JFsqULSS7t/0Vtf/P+LCjKzFKZC8HrMdqCN8K+8sb RFKzTxutJENYagnZCbkiflBNVdani+Qi6CVYx305tf0azxrO29z9COoU0VLOdzqEctJZ aRv+/CHJq4giGJ1LbFcSFhUHhKn4wG6lERuqfmUFiiHv+E0zvxCen9r7f9p969psoLby HeMBiblSFQKtavWHFsuIheC5Tf/u4HbxkJrTz5DLSE+oo8vWsqx2C5pXbqsFj1ZRzHMC LwkRZ4cebmeLDiBQ+qXoPjiO+S6V3AbkJg/StYY/0CfnK8IoGS6ms+DIjt8ZaGvh+q3J qdJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gc0kS4FWeyRgh8FzaGJrEEK3oQhvg2mltOYTUWODP9M=; b=CcY0XESbSwDTUnxYjVRJw1Cybb28jEIWFcegSoRdpKwdzoHH/uBf85p1aD74ro/jPY bLQi3GetWKdh6kK4fBu2vVVczAjCV2zlJ3FTzSTmFmouVnxqINuiggJzvbD1XZn8Jtcv bxVY2e/H6z1bMJy7b28nI7qsM6ghu0vHqgYcT4snvPGnBI7sE962+mN5DPDtKo3umv0G gp2hfmdJ/41pAuTHVLQqkVlKZDmtnWK3qBUsVyPBNXH3UDtOOCXRRWC5uUUWo/rTzJho niFSewOrbzRh6pbraXUqV0N8JYSW+0hs6505Ua0DsVDZUgrwWdO03ZoHotZfFPA2Sc7u Ywzw== X-Gm-Message-State: AOPr4FUZp3AycQhy+FNRAz7b2D13ObRYxFIPCXI64jWFBXyVIn/9dFhiiCuR8iaiGi6fQdCGYL17EyBjBl5jXQ== X-Received: by 10.112.73.40 with SMTP id i8mr2082259lbv.101.1462304473697; Tue, 03 May 2016 12:41:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.20.194 with HTTP; Tue, 3 May 2016 12:40:43 -0700 (PDT) From: Victor Toni Date: Tue, 3 May 2016 21:40:43 +0200 Message-ID: Subject: undeclared identifier 'NBBY' To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2016 19:41:15 -0000 I'm trying to port the linux-based mcproxy ( https://github.com/mcproxy/mcproxy) to FreeBSD. While trying to use instead of I encountered the following error: -------------------------------------------------------------------- /usr/include/netinet6/ip6_mroute.h:90:39: error: use of undeclared identifier 'NBBY' if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)]; ^ /usr/include/netinet6/ip6_mroute.h:83:36: note: expanded from macro 'NIFBITS' #define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */ ^ /usr/include/netinet6/ip6_mroute.h:86:33: note: expanded from macro 'howmany' #define howmany(x, y) (((x) + ((y) - 1)) / (y)) ^ /usr/include/netinet6/ip6_mroute.h:90:39: error: use of undeclared identifier 'NBBY' /usr/include/netinet6/ip6_mroute.h:83:36: note: expanded from macro 'NIFBITS' #define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */ ^ /usr/include/netinet6/ip6_mroute.h:86:45: note: expanded from macro 'howmany' #define howmany(x, y) (((x) + ((y) - 1)) / (y)) ^ -------------------------------------------------------------------- The error results from the missing definition of NBBY or rather the missing include of where NBBY is defined. My expectation would be that header files should be self-sufficient and as such should include on its own. What is the prefered way to work with header files in FreeBSD? Or is it a bug in the header file? Best regards, Victor