diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-08 17:03:31 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-08 17:04:29 +0100 |
commit | cc5b93f72db80abd1262a0a5e1d8400ceef54385 (patch) | |
tree | 42d75cb7898c6b6077e9cfbb04074cfc84e38930 /nest/rt-attr.c | |
parent | 5de0e848de06a9187046dbc380d9ce6a6f8b21a2 (diff) | |
parent | f51b1f556595108d53b9f4580bfcb96bfbc85442 (diff) |
Merge tag 'v1.6.2' into int-new
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r-- | nest/rt-attr.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 167bfc44..bb2b3561 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -250,6 +250,34 @@ mpnh_merge(struct mpnh *x, struct mpnh *y, int rx, int ry, int max, linpool *lp) return root; } +void +mpnh_insert(struct mpnh **n, struct mpnh *x) +{ + for (; *n; n = &((*n)->next)) + { + int cmp = mpnh_compare_node(*n, x); + + if (cmp < 0) + continue; + else if (cmp > 0) + break; + else + return; + } + + x->next = *n; + *n = x; +} + +int +mpnh_is_sorted(struct mpnh *x) +{ + for (; x && x->next; x = x->next) + if (mpnh_compare_node(x, x->next) >= 0) + return 0; + + return 1; +} static struct mpnh * mpnh_copy(struct mpnh *o) @@ -1114,7 +1142,7 @@ rta_dump(rta *a) static char *rts[] = { "RTS_DUMMY", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE", "RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP", "RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1", - "RTS_OSPF_EXT2", "RTS_BGP" }; + "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" }; static char *rtc[] = { "", " BC", " MC", " AC" }; static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" }; |