-static char tstr[] = " [|ospf]";
-
-/* Forwards */
-static inline void ospf6_print_seqage(u_int32_t, time_t);
-static inline void ospf6_print_bits(const struct bits *, u_char);
-static void ospf6_print_ls_type(u_int, const rtrid_t *,
- const rtrid_t *, const char *);
-static int ospf6_print_lshdr(const struct lsa_hdr *);
-static int ospf6_print_lsa(const struct lsa *);
-static int ospf6_decode_v3(const struct ospf6hdr *, const u_char *);
-
-static inline void
-ospf6_print_seqage(register u_int32_t seq, register time_t us)
-{
- register time_t sec = us % 60;
- register time_t mins = (us / 60) % 60;
- register time_t hour = us / 3600;
-
- printf(" S %X age ", seq);
- if (hour)
- printf("%u:%02u:%02u",
- (u_int32_t) hour, (u_int32_t) mins, (u_int32_t) sec);
- else if (mins)
- printf("%u:%02u", (u_int32_t) mins, (u_int32_t) sec);
- else
- printf("%u", (u_int32_t) sec);
-}
-
-
-static inline void
-ospf6_print_bits(register const struct bits *bp, register u_char options)
-{
- register char sep = ' ';
-
- do {
- if (options & bp->bit) {
- printf("%c%s", sep, bp->str);
- sep = '/';
- }
- } while ((++bp)->bit);
-}
-
-static void
-ospf6_print_ls_type(register u_int ls_type,
- register const rtrid_t *ls_stateid,
- register const rtrid_t *ls_router, register const char *fmt)
-{
- char *scope;
-
- switch (ls_type & LS_SCOPE_MASK) {
- case LS_SCOPE_LINKLOCAL:
- scope = "linklocal-";
- break;
- case LS_SCOPE_AREA:
- scope = "area-";
- break;
- case LS_SCOPE_AS:
- scope = "AS-";
- break;
- default:
- scope = "";
- break;
- }
-
- switch (ls_type & LS_TYPE_MASK) {
- case LS_TYPE_ROUTER:
- printf(" %srtr %s", scope, ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_NETWORK:
- printf(" %snet dr %s if %s", scope,
- ipaddr_string(ls_router),
- ipaddr_string(ls_stateid));
- break;
+static struct tok ospf6_type_values[] = {
+ { OSPF_TYPE_HELLO, "Hello" },
+ { OSPF_TYPE_DD, "Database Description" },
+ { OSPF_TYPE_LS_REQ, "LS-Request" },
+ { OSPF_TYPE_LS_UPDATE, "LS-Update" },
+ { OSPF_TYPE_LS_ACK, "LS-Ack" },
+ { 0, NULL }
+};