@@ -2,7 +2,8 @@
[userv-utils] / ipif / udptunnel-vpn-config.m4
CommitLineData
ee498ba1 1m4_dnl udptunnel-vpn-config.m4: macros for udptunnel-reconf et al
2
3m4_dnl This is free software; you can redistribute it and/or modify it
4m4_dnl under the terms of the GNU General Public License as published by
5m4_dnl the Free Software Foundation; either version 2 of the License, or
6m4_dnl (at your option) any later version.
7m4_dnl
8m4_dnl This program is distributed in the hope that it will be useful, but
9m4_dnl WITHOUT ANY WARRANTY; without even the implied warranty of
10m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11m4_dnl General Public License for more details.
12m4_dnl
13m4_dnl You should have received a copy of the GNU General Public License
14m4_dnl along with userv-utils; if not, write to the Free Software
15m4_dnl Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16m4_dnl
17m4_dnl $Id: udptunnel-vpn-config.m4,v 1.1.2.2 2000/12/11 01:53:01 ian Exp $
18
2dba6494 19m4_define(V_JUNK,1)m4_divert(V_JUNK)
20m4_define(V_VARIABLE,2)
21m4_define(V_ACTIVES,3)
22m4_define(V_PASSIVES,4)
23m4_changequote([,])
24
25m4_define(V_WARGS, [
26 m4_define([$1], [m4_ifelse($][#,$2,[$3],
27 [# ]m4___file__:m4___line__[: wrong number of args to $1])])])
28
29V_WARGS([SET], 2, [V_SET([V_$1], [$2])])
30m4_define(V_YES, [m4_define([V_SET],[m4_define($][@)])])
31m4_define(V_NO, [m4_define([V_SET], [])])
32
33m4_define(V_ACTPA, [
34 V_WARGS($1, 1, [m4_divert(V_$1S)$][1 m4_dnl
35 m4_divert(V_JUNK)m4_ifelse($][1,V_site,
36 [V_YES],
37 [V_NO]
38)])])
39
40m4_dnl V_WARGS(, 2, [m4_divert(V_PASSIVES)$1 m4_dnl
41m4_dnl m4_divert(V_JUNK)m4_ifelse([$1],V_site, [$2])])
42
43m4_divert(V_JUNK)
44
45V_YES
46m4_include(V_defaults)
47m4_include(V_global)
48
49V_WARGS(SITE, 1, [m4_ifelse([$1],V_site, [V_YES], [V_NO])])
50V_YES
51m4_include(V_sites)
52m4_undefine([SITE])
53
54V_ACTPA(ACTIVE)
55V_ACTPA(PASSIVE)
56V_YES
57m4_include(V_tunnels)
58
59m4_divert(V_VARIABLE)
60WHVARIABLE
61m4_divert(V_JUNK)
62
63m4_define(V_WANTED, V_[]WANTED)
64m4_divert(0)
65m4_undivert(V_WANTED)
66m4_divert(-1)
67m4_undivert(V_JUNK)
68m4_undivert(V_ACTIVES)
69m4_undivert(V_PASSIVES)
70m4_undivert(V_VARIABLE)