}
$str =~ s/ $//;
push @lines, $str . "\\n\" \\\n";
- push @lines, " \" > - selected route, * - FIB route, q - queued, r - rejected, b - backup\\n\\n\"";
+ push @lines, " \" > - selected route, * - FIB route, q - queued, r - rejected, b - backup\\n\"";
+ push @lines, " \" t - trapped, o - offload failure\\n\"";
+
+
return join("", @lines);
}
* route entry. This mainly is used for backup static routes.
*/
#define ZEBRA_FLAG_RR_USE_DISTANCE 0x40
+/*
+ * This flag tells everyone that the route was intentionally
+ * not offloaded and the route will be sent to the cpu for
+ * forwarding. This flag makes no sense unless you are in
+ * an asic offload situation
+ */
+#define ZEBRA_FLAG_TRAPPED 0x80
+/*
+ * This flag tells everyone that the route has been
+ * successfully offloaded to an asic for forwarding.
+ * This flag makes no sense unless you are in an asic
+ * offload situation.
+ */
+#define ZEBRA_FLAG_OFFLOADED 0x100
/* The older XXX_MESSAGE flags live here */
uint32_t message;
lines = output.splitlines()
header_found = False
while lines and (not lines[0].strip() or not header_found):
- if "> - selected route" in lines[0]:
+ if "o - offload failure" in lines[0]:
header_found = True
lines = lines[1:]
return "\n".join(lines)
lines = output.splitlines()
header_found = False
while lines and (not lines[0].strip() or not header_found):
- if "> - selected route" in lines[0]:
+ if "o - offload failure" in lines[0]:
header_found = True
lines = lines[1:]
return 0;
}
+ if (rtm->rtm_flags & RTM_F_TRAP)
+ flags |= ZEBRA_FLAG_TRAPPED;
+ if (rtm->rtm_flags & RTM_F_OFFLOAD)
+ flags |= ZEBRA_FLAG_OFFLOADED;
+
/* Route which inserted by Zebra. */
if (selfroute) {
flags |= ZEBRA_FLAG_SELFROUTE;
star_p = true;
}
+ if (zrouter.asic_offloaded
+ && CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED))
+ return 't';
+
+ if (zrouter.asic_offloaded
+ && !CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
+ return 'o';
+
if (star_p)
return '*';
else
if (CHECK_FLAG(re->status, ROUTE_ENTRY_QUEUED))
json_object_boolean_true_add(json_route, "queued");
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED))
+ json_object_boolean_true_add(json_route, "trapped");
+
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
+ json_object_boolean_true_add(json_route, "offloaded");
+
if (re->tag)
json_object_int_add(json_route, "tag", re->tag);