diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-05-11 18:52:59 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-05-14 10:22:14 +0200 |
commit | 0ec031f7400fbacdd86b40ae1870c58715a7f108 (patch) | |
tree | a83ed4706b72e3d6f63361060b4c6991c15c2023 /proto/ospf | |
parent | 47c447c42e0bfa1836d951d1e6c1a2236d39dcbb (diff) |
Allows to set instance ID for OSPFv3 interfaces.
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/config.Y | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index 38e59886..0c36b7f8 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -107,7 +107,17 @@ static inline void check_defcost(int cost) { if ((cost <= 0) || (cost >= LSINFINITY)) - cf_error("Default cost must be in range 1-%d", LSINFINITY); + cf_error("Default cost must be in range 1-%d", LSINFINITY-1); +} + +static inline void +set_instance_id(unsigned id) +{ +#ifdef OSPFv3 + OSPF_PATT->instance_id = id; +#else + cf_error("Instance ID requires OSPFv3"); +#endif } CF_DECLS @@ -120,7 +130,7 @@ CF_KEYWORDS(NONE, SIMPLE, AUTHENTICATION, STRICT, CRYPTOGRAPHIC) CF_KEYWORDS(ELIGIBLE, POLL, NETWORKS, HIDDEN, VIRTUAL, CHECK, LINK) CF_KEYWORDS(RX, BUFFER, LARGE, NORMAL, STUBNET, HIDDEN, SUMMARY, TAG, EXTERNAL) CF_KEYWORDS(WAIT, DELAY, LSADB, ECMP, LIMIT, WEIGHT, NSSA, TRANSLATOR, STABILITY) -CF_KEYWORDS(GLOBAL, LSID, ROUTER, SELF) +CF_KEYWORDS(GLOBAL, LSID, ROUTER, SELF, INSTANCE) %type <t> opttext %type <ld> lsadb_args @@ -218,8 +228,8 @@ ospf_stubnet_item: ; ospf_vlink: - ospf_vlink_start '{' ospf_vlink_opts '}' { ospf_iface_finish(); } - | ospf_vlink_start { ospf_iface_finish(); } + ospf_vlink_start ospf_instance_id '{' ospf_vlink_opts '}' { ospf_iface_finish(); } + | ospf_vlink_start ospf_instance_id { ospf_iface_finish(); } ; ospf_vlink_opts: @@ -364,6 +374,11 @@ ospf_iface_start: } ; +ospf_instance_id: + /* empty */ + | INSTANCE expr { set_instance_id($2); } + ; + ospf_iface_opts: /* empty */ | ospf_iface_opts ospf_iface_item ';' @@ -375,7 +390,7 @@ ospf_iface_opt_list: ; ospf_iface: - ospf_iface_start iface_patt_list ospf_iface_opt_list { ospf_iface_finish(); } + ospf_iface_start iface_patt_list ospf_instance_id ospf_iface_opt_list { ospf_iface_finish(); } ; opttext: |