Re: cpp change breaks ipfw

2000-02-28 Thread Gregory Bond
I wrote: > when fed through an ANSI preprocessor (i.e. not "gcc -E" and not /usr/bin/cpp > on 3.x!). This also works if (e.g.) addr is defined on the command line. and of course I _meant_ to write "(i.e. "gcc -E" and not /usr/bin/cpp..." gcc -E _is_ an ANSI cpp. To Unsubscribe: send mail to

Re: cpp change breaks ipfw

2000-02-28 Thread Gregory Bond
> #define addr 192.186.2.5 > #define mask 255.255.240.0 > > #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup > rule(addr,mask) This is a well-known artifact of the ANSI C rules. You need to do two levels of macro in order to get the macro args expanded in the paste o

Re: cpp change breaks ipfw

2000-02-28 Thread Kai Großjohann
Jim Bloom <[EMAIL PROTECTED]> writes: > That small test works fine, but doesn't solve the problem I was having. Oops. Sorry. kai -- ~/.signature: No such file or directory To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message

Re: cpp change breaks ipfw

2000-02-28 Thread Tony Finch
Jim Bloom <[EMAIL PROTECTED]> wrote: > >That small test works fine, but doesn't solve the problem I was having. Try >this small test case to see my problem: > >#define addr 192.186.2.5 >#define mask 255.255.240.0 > >#define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup >rule

Re: cpp change breaks ipfw

2000-02-28 Thread Jim Bloom
Kai Großjohann wrote: > > / > | $ cat foo > | #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup > | rule(192.168.2.5,255.255.254.0) > | $ type cpp > | cpp is hashed (/usr/bin/cpp) > | $ cpp foo > | # 1 "foo" > | > | add pass tcp from 192.168.2.5:255.255.254.0 to an

Re: cpp change breaks ipfw

2000-02-28 Thread Kai Großjohann
Jim Bloom <[EMAIL PROTECTED]> writes: > No. It has the same bug. That method of concatenation only works > for strings. Well, I tried it and got the following: / | $ cat foo | #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup | rule(192.168.2.5,255.255.254.0) | $

Re: cpp change breaks ipfw

2000-02-28 Thread Jim Bloom
No. It has the same bug. That method of concatenation only works for strings. Jim Bloom [EMAIL PROTECTED] Kai Großjohann wrote: > / > | #define rule(ADDR,MASK) \ > | add pass tcp from ADDR ## : ## MASK to any 25 setup > | > | rule(192.168.2.5,255.255.254.0) > \ > > Does it do what you

Re: cpp change breaks ipfw

2000-02-28 Thread Kai Großjohann
Jim Bloom <[EMAIL PROTECTED]> writes: > On the old version of current this expands to > > add pass tcp from 192.168.2.5:255.255.254.0 to any 25 setup > > but on a new version of current this expands to > > add pass tcp from 192.168.2.5 : 255.255.254.0 to any 25 setup You might wis

Re: cpp change breaks ipfw

2000-02-28 Thread David O'Brien
On Sun, Feb 27, 2000 at 12:48:53AM -0500, Jim Bloom wrote: > but on a new version of current this expands to > > add pass tcp from 192.168.2.5 : 255.255.254.0 to any 25 setup > > Note the extra spaces around the colon. This is required by the ANSI-C spec. Tokens replaced by `cpp' shall b

Re: cpp change breaks ipfw

2000-02-26 Thread Andrew Reilly
On Sun, Feb 27, 2000 at 12:48:53AM -0500, Jim Bloom wrote: > I have been using cpp on my firewall to expand my local firewall rules and fill > in the local address and subnetmask. This makes things easier my ISP decides to > change my IP address using DHCP. My firewall is running an approximatel