[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ipf and cpp with '!' in rules



On Monday 26 March 2001 00:15, Crist J. Clark wrote:
> I am trying to use cpp as a preprocessor for ipf rules. However, I am
> having a problem I saw coming. cpp will insert spaces between a
> "define" token and a preceding '!', and ipf does not like a that.
>
> Example,
>
>   #define IP_ADDR 192.0.2.1
>
>   block in quick from !IP_ADDR to any
>
> Will expand to,
>
>   block in quick from ! 192.0.2.1 to any
>
> Which ipf does not like.
>
> Anyone have a trick to get around this? Thanks.

Use sed:
  cat cpp.file  | sed -e "s/\! /\!/"  >  ipf.rules