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