summaryrefslogtreecommitdiffstats
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-08-02 13:11:53 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-08-02 13:11:53 +0200
commitba5e5940aa1f11128c76a3964823bda22e47ab04 (patch)
tree7bd7dc426fb1d3ee2b940d981159fdf9780883ec /nest/rt-attr.c
parentd395fe48553062413a85fd04cda0752f933e70c6 (diff)
downloadbird-ba5e5940aa1f11128c76a3964823bda22e47ab04.tar
bird-ba5e5940aa1f11128c76a3964823bda22e47ab04.zip
Adds igp_metric attribute.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index d714818..ce6fe85 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -362,6 +362,18 @@ ea_free(ea_list *o)
}
}
+static int
+get_generic_attr(eattr *a, byte **buf, int buflen UNUSED)
+{
+ if (a->id == EA_GEN_IGP_METRIC)
+ {
+ *buf += bsprintf(*buf, "igp_metric");
+ return GA_NAME;
+ }
+
+ return GA_UNKNOWN;
+}
+
/**
* ea_format - format an &eattr for printing
* @e: attribute to be formatted
@@ -392,6 +404,9 @@ ea_format(eattr *e, byte *buf)
}
else if (EA_PROTO(e->id))
buf += bsprintf(buf, "%02x.", EA_PROTO(e->id));
+ else
+ status = get_generic_attr(e, &buf, end - buf);
+
if (status < GA_NAME)
buf += bsprintf(buf, "%02x", EA_ID(e->id));
if (status < GA_FULL)