From owner-freebsd-bugs Sat Aug 12 00:54:21 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id AAA16367 for bugs-outgoing; Sat, 12 Aug 1995 00:54:21 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id AAA16361 for ; Sat, 12 Aug 1995 00:54:19 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA04718; Sat, 12 Aug 1995 09:54:16 +0200 Received: by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id JAA05803; Sat, 12 Aug 1995 09:54:16 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id JAA18320; Sat, 12 Aug 1995 09:47:59 +0200 From: J Wunsch Message-Id: <199508120747.JAA18320@uriah.heep.sax.de> Subject: Re: 950726-SNAP lp0/nfs install bug ? To: jkh@freefall.FreeBSD.org (Jordan K. Hubbard) Date: Sat, 12 Aug 1995 09:47:56 +0200 (MET DST) Cc: freebsd-bugs@FreeBSD.org, joerg_wunsch@uriah.heep.sax.de In-Reply-To: <8860.808173419@freefall.FreeBSD.org> from "Jordan K. Hubbard" at Aug 11, 95 01:36:59 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 642 Sender: bugs-owner@FreeBSD.org Precedence: bulk As Jordan K. Hubbard wrote: > > Hmmm. Anyone willing to give me a little formula to calculate > netmask based on IP address? Then I could also fill it in.. :-) unsigned char addr_high; unsigned int netmask; addr_high = ...; /* highest byte of IP address */ if(addr_high < 128) netmask = 0xff000000; else if(addr_high < 192) netmask = 0xffff0000; else if(addr_high < 224) netmask = 0xffffff00; else /* multicast or class E -- not particularly useful */ netmask = 0xffffffff; -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)