4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
34 #include <sys/types.h>
36 #include <sys/socket.h>
37 #include <sys/sockio.h>
39 #include <netinet/in_systm.h>
40 #include <netinet/in.h>
41 #include <netinet/ip.h>
42 #include <netinet/if_ether.h>
43 #include <arpa/inet.h>
45 #include "snoop_ospf.h"
46 #include "snoop_ospf6.h"
48 extern char *dlc_header
;
49 static char *sum_line
;
51 char *ospf_types
[] = {
60 static char *ospf_authtypes
[] = {
66 const struct bits ospf_rla_flag_bits
[] = {
74 const struct bits ospf_db_flags_bits
[] = {
75 { OSPF_DB_INIT
, "I" },
76 { OSPF_DB_MORE
, "M" },
77 { OSPF_DB_MASTER
, "MS" },
81 const struct bits ospf_option_bits
[] = {
82 { OSPF_OPTION_T
, "T" },
83 { OSPF_OPTION_E
, "E" },
84 { OSPF_OPTION_MC
, "MC" },
88 static int interpret_ospf_hello(int, struct ospfhdr
*, int);
89 static void ospf_print_ls_type(int, uint32_t, struct in_addr
, struct in_addr
);
90 static void interpret_ospf_lsa_hdr(int, struct lsa_hdr
*);
91 static int interpret_ospf_lsa(int flags
, struct lsa
*lsa
, uchar_t
*);
94 ospf_print_bits(const struct bits
*bp
, uchar_t options
)
96 static char bitstring
[32];
100 if (options
& bp
->bit
) {
101 strcat(bitstring
, bp
->str
);
102 strcat(bitstring
, "/");
104 } while ((++bp
)->bit
);
106 /* wipe out the trailing "/" */
107 bitstring
[strlen(bitstring
) - 1] = '\0';
112 ospf_print_lsa_age(long age
)
114 long sec
, mins
, hour
;
115 static char lsa_age
[16];
118 mins
= (age
/ 60) % 60;
121 snprintf(lsa_age
, sizeof (lsa_age
), "%u:%02u:%02u",
124 snprintf(lsa_age
, sizeof (lsa_age
), "%u:%02u", mins
, sec
);
126 snprintf(lsa_age
, sizeof (lsa_age
), "%u", sec
);
131 interpret_ospf_hello(int flags
, struct ospfhdr
*op
, int fraglen
)
136 if (fraglen
< OSPF_MIN_HEADER_SIZE
+ OSPF_MIN_HELLO_HEADER_SIZE
)
137 return (-1); /* truncated packet */
140 if (op
->ospf_hello
.hello_dr
.s_addr
!= 0) {
141 (void) sprintf(sum_line
, "DR=%s ",
142 inet_ntoa(op
->ospf_hello
.hello_dr
));
144 sum_line
+= strlen(sum_line
);
145 if (op
->ospf_hello
.hello_bdr
.s_addr
!= 0) {
146 (void) sprintf(sum_line
, "BDR=%s ",
147 inet_ntoa(op
->ospf_hello
.hello_bdr
));
149 sum_line
+= strlen(sum_line
);
150 nbr
= op
->ospf_hello
.hello_neighbor
;
152 while ((uchar_t
*)nbr
< ((uchar_t
*)op
+ fraglen
)) {
153 if ((uchar_t
*)nbr
+ sizeof (struct in_addr
) >
154 ((uchar_t
*)op
+ fraglen
))
155 return (-1); /* truncated */
159 (void) sprintf(sum_line
, "%d nbrs", j
);
160 sum_line
+= strlen(sum_line
);
163 if (flags
& F_DTAIL
) {
164 show_header("OSPF HELLO: ", "Hello Packet",
165 ntohs(op
->ospf_len
));
167 (void) snprintf(get_line(0, 0), get_line_remain(),
168 "Options = %s", ospf_print_bits(ospf_option_bits
,
169 op
->ospf_hello
.hello_options
));
170 (void) snprintf(get_line(0, 0), get_line_remain(), "Mask = %s",
171 inet_ntoa(op
->ospf_hello
.hello_mask
));
172 (void) snprintf(get_line(0, 0), get_line_remain(),
173 "Hello interval = %d",
174 ntohs(op
->ospf_hello
.hello_helloint
));
175 (void) snprintf(get_line(0, 0), get_line_remain(),
176 "Priority = %d", op
->ospf_hello
.hello_priority
);
177 (void) snprintf(get_line(0, 0), get_line_remain(),
178 "Dead interval = %u", ntohl(op
->ospf_hello
.hello_deadint
));
179 if (op
->ospf_hello
.hello_dr
.s_addr
!= 0) {
180 (void) snprintf(get_line(0, 0), get_line_remain(),
181 "Designated Router = %s",
182 inet_ntoa(op
->ospf_hello
.hello_dr
));
184 if (op
->ospf_hello
.hello_bdr
.s_addr
!= 0) {
185 (void) snprintf(get_line(0, 0), get_line_remain(),
186 "Backup Designated Router = %s",
187 inet_ntoa(op
->ospf_hello
.hello_bdr
));
189 nbr
= op
->ospf_hello
.hello_neighbor
;
190 while ((uchar_t
*)nbr
< ((uchar_t
*)op
+ fraglen
)) {
191 if ((uchar_t
*)nbr
+ sizeof (struct in_addr
) >
192 ((uchar_t
*)op
+ fraglen
))
193 return (-1); /* truncated */
194 (void) snprintf(get_line(0, 0), get_line_remain(),
195 "Neighbor: %s", inet_ntoa(*nbr
));
203 ospf_print_ls_type(int flags
, uint32_t ls_type
, struct in_addr ls_stateid
,
204 struct in_addr ls_router
)
209 sprintf(sum_line
, " rtr %s ", inet_ntoa(ls_router
));
210 sum_line
+= strlen(sum_line
);
212 if (flags
& F_DTAIL
) {
213 (void) snprintf(get_line(0, 0), get_line_remain(),
214 "Router LSA; Router = %s ", inet_ntoa(ls_router
));
217 case LS_TYPE_NETWORK
:
219 sprintf(sum_line
, " net dr %s ", inet_ntoa(ls_router
));
220 sum_line
+= strlen(sum_line
);
221 sprintf(sum_line
, "if %s ", inet_ntoa(ls_stateid
));
222 sum_line
+= strlen(sum_line
);
224 if (flags
& F_DTAIL
) {
225 (void) snprintf(get_line(0, 0), get_line_remain(),
226 "Network LSA Router = %s ", inet_ntoa(ls_router
));
227 (void) snprintf(get_line(0, 0), get_line_remain(),
229 inet_ntoa(ls_stateid
));
234 sprintf(sum_line
, " sum %s ", inet_ntoa(ls_stateid
));
235 sum_line
+= strlen(sum_line
);
236 sprintf(sum_line
, "abr %s ", inet_ntoa(ls_router
));
237 sum_line
+= strlen(sum_line
);
239 if (flags
& F_DTAIL
) {
240 (void) snprintf(get_line(0, 0), get_line_remain(),
241 "Summary LSA IP = %s ", inet_ntoa(ls_stateid
));
242 (void) snprintf(get_line(0, 0), get_line_remain(),
243 " Area Border Router = %s ",
244 inet_ntoa(ls_router
));
247 case LS_TYPE_SUM_ABR
:
249 sprintf(sum_line
, "abr %s ", inet_ntoa(ls_stateid
));
250 sum_line
+= strlen(sum_line
);
251 sprintf(sum_line
, "asbr %s ", inet_ntoa(ls_router
));
252 sum_line
+= strlen(sum_line
);
254 if (flags
& F_DTAIL
) {
255 (void) snprintf(get_line(0, 0), get_line_remain(),
256 "ASBR Summary abr = %s ", inet_ntoa(ls_stateid
));
257 (void) snprintf(get_line(0, 0), get_line_remain(),
258 " asbr = %s ", inet_ntoa(ls_router
));
263 sprintf(sum_line
, " ase %s", inet_ntoa(ls_stateid
));
264 sum_line
+= strlen(sum_line
);
265 sprintf(sum_line
, " asbr %s", inet_ntoa(ls_router
));
266 sum_line
+= strlen(sum_line
);
268 if (flags
& F_DTAIL
) {
269 (void) snprintf(get_line(0, 0), get_line_remain(),
270 "AS External LSA ase = %s ", inet_ntoa(ls_stateid
));
271 (void) snprintf(get_line(0, 0), get_line_remain(),
272 " asbr = %s ", inet_ntoa(ls_router
));
278 sprintf(sum_line
, " group %s", inet_ntoa(ls_stateid
));
279 sum_line
+= strlen(sum_line
);
280 sprintf(sum_line
, " rtr %s", inet_ntoa(ls_router
));
281 sum_line
+= strlen(sum_line
);
283 if (flags
& F_DTAIL
) {
284 (void) snprintf(get_line(0, 0), get_line_remain(),
285 "Group LSA %s ", inet_ntoa(ls_stateid
));
286 (void) snprintf(get_line(0, 0), get_line_remain(),
287 " rtr = %s ", inet_ntoa(ls_router
));
292 sprintf(sum_line
, " unknown LSA type %d", ls_type
);
293 sum_line
+= strlen(sum_line
);
295 if (flags
& F_DTAIL
) {
296 (void) snprintf(get_line(0, 0), get_line_remain(),
297 "Unknown LSA type %d", ls_type
);
304 interpret_ospf_lsa_hdr(int flags
, struct lsa_hdr
*lsah
)
309 if (flags
& F_DTAIL
) {
310 (void) snprintf(get_line(0, 0), get_line_remain(),
312 ospf_print_bits(ospf_option_bits
, lsah
->ls_options
));
313 (void) snprintf(get_line(0, 0), get_line_remain(),
314 "Sequence = %X ", ntohl(lsah
->ls_seq
));
315 (void) snprintf(get_line(0, 0), get_line_remain(),
316 "Age = %X ", ospf_print_lsa_age(ntohs(lsah
->ls_age
)));
319 ospf_print_ls_type(flags
, lsah
->ls_type
, lsah
->ls_stateid
,
324 #define TRUNC(addr) ((uchar_t *)(addr) > fragend)
326 interpret_ospf_lsa(int flags
, struct lsa
*lsa
, uchar_t
*fragend
)
331 struct tos_metric
*tosp
;
332 struct in_addr
*addr
;
334 struct aslametric
*am
;
338 interpret_ospf_lsa_hdr(flags
, &lsa
->ls_hdr
);
340 ls_end
= (uchar_t
*)lsa
+ ntohs(lsa
->ls_hdr
.ls_length
);
345 switch (lsa
->ls_hdr
.ls_type
) {
348 if (TRUNC(&lsa
->lsa_un
.un_rla
.rla_flags
))
351 if (flags
& F_DTAIL
) {
352 (void) ospf_print_bits(ospf_rla_flag_bits
,
353 lsa
->lsa_un
.un_rla
.rla_flags
);
356 if (TRUNC(&lsa
->lsa_un
.un_rla
.rla_count
))
358 rla_count
= ntohs(lsa
->lsa_un
.un_rla
.rla_count
);
360 rl
= lsa
->lsa_un
.un_rla
.rla_link
;
364 while (rla_count
-- != 0) {
365 if (TRUNC((uchar_t
*)rl
+ sizeof (*rl
)))
367 switch (rl
->link_type
) {
368 case RLA_TYPE_VIRTUAL
:
369 if (flags
& F_DTAIL
) {
370 (void) snprintf(get_line(0, 0),
371 get_line_remain(), "Virtual Link");
374 case RLA_TYPE_ROUTER
:
375 if (flags
& F_DTAIL
) {
376 (void) snprintf(get_line(0, 0),
377 get_line_remain(), "Neighbor = %s",
378 inet_ntoa(rl
->link_id
));
379 (void) snprintf(get_line(0, 0),
380 get_line_remain(), "Interface = %s",
381 inet_ntoa(rl
->link_data
));
384 case RLA_TYPE_TRANSIT
:
385 if (flags
& F_DTAIL
) {
386 (void) snprintf(get_line(0, 0),
388 "Designated Router = %s",
389 inet_ntoa(rl
->link_id
));
390 (void) snprintf(get_line(0, 0),
391 get_line_remain(), "Interface = %s",
392 inet_ntoa(rl
->link_data
));
396 if (flags
& F_DTAIL
) {
397 (void) snprintf(get_line(0, 0),
398 get_line_remain(), "Network = %s",
399 inet_ntoa(rl
->link_id
));
400 (void) snprintf(get_line(0, 0),
401 get_line_remain(), "Mask = %s",
402 inet_ntoa(rl
->link_data
));
406 if (flags
& F_DTAIL
) {
407 (void) snprintf(get_line(0, 0),
409 "Unknown link type %d",
414 if (flags
& F_DTAIL
) {
415 (void) snprintf(get_line(0, 0),
416 get_line_remain(), "TOS 0 metric = %d",
417 ntohs(rl
->link_tos0metric
));
419 tosp
= (struct tos_metric
*)(
420 (uchar_t
*)rl
+ sizeof (rl
->link_tos0metric
));
421 for (k
= 0; k
> (int)rl
->link_toscount
; ++k
, ++tosp
) {
424 if (flags
& F_DTAIL
) {
425 (void) snprintf(get_line(0, 0),
427 "TOS %d metric = %d",
429 ntohs(tosp
->tos_metric
));
433 rl
= (struct rlalink
*)((uchar_t
*)(rl
+ 1) +
434 ((rl
->link_toscount
) * sizeof (*tosp
)));
436 return (-1); /* truncated */
439 case LS_TYPE_NETWORK
:
441 if (TRUNC(&lsa
->lsa_un
.un_nla
.nla_mask
))
444 if (flags
& F_DTAIL
) {
445 snprintf(get_line(0, 0), get_line_remain(),
447 inet_ntoa(lsa
->lsa_un
.un_nla
.nla_mask
));
448 snprintf(get_line(0, 0), get_line_remain(),
451 addr
= lsa
->lsa_un
.un_nla
.nla_router
;
452 while ((uchar_t
*)addr
< ls_end
) {
453 if ((uchar_t
*)addr
+ sizeof (struct in_addr
) > ls_end
)
454 return (-1); /* truncated */
455 if (flags
& F_DTAIL
) {
456 snprintf(get_line(0, 0), get_line_remain(),
457 "\t%s", inet_ntoa(*addr
));
464 if (TRUNC((uchar_t
*)&lsa
->lsa_un
.un_sla
.sla_mask
+
465 sizeof (struct in_addr
)))
468 if (flags
& F_DTAIL
) {
469 snprintf(get_line(0, 0), get_line_remain(), "Mask = %s",
470 inet_ntoa(lsa
->lsa_un
.un_sla
.sla_mask
));
473 case LS_TYPE_SUM_ABR
:
474 if (TRUNC(&lsa
->lsa_un
.un_sla
.sla_tosmetric
))
476 tosmetric
= lsa
->lsa_un
.un_sla
.sla_tosmetric
;
477 while ((uchar_t
*)tosmetric
< ls_end
) {
478 if ((uchar_t
*)tosmetric
+ sizeof (tm
) > fragend
)
479 return (-1); /* truncated */
480 tm
= ntohl(*tosmetric
);
481 tos
= (tm
& SLA_MASK_TOS
) >> SLA_SHIFT_TOS
;
482 metric
= tm
& SLA_MASK_METRIC
;
483 if (flags
& F_DTAIL
) {
484 snprintf(get_line(0, 0), get_line_remain(),
485 " tos %d metric %d", tos
, metric
);
491 if (TRUNC(&lsa
->lsa_un
.un_asla
.asla_mask
))
493 if (flags
& F_DTAIL
) {
494 snprintf(get_line(0, 0), get_line_remain(), "Mask = %s",
495 inet_ntoa(lsa
->lsa_un
.un_asla
.asla_mask
));
497 am
= lsa
->lsa_un
.un_asla
.asla_metric
;
498 while ((uchar_t
*)am
< ls_end
) {
499 if ((uchar_t
*)am
+ sizeof (tm
) > fragend
)
500 return (-1); /* truncated */
501 tm
= ntohl(am
->asla_tosmetric
);
502 tos
= (tm
& ASLA_MASK_TOS
) >> ASLA_SHIFT_TOS
;
503 metric
= tm
& ASLA_MASK_METRIC
;
504 if (flags
& F_DTAIL
) {
505 snprintf(get_line(0, 0), get_line_remain(),
506 " type %d tos %d metric %d",
507 (tm
& ASLA_FLAG_EXTERNAL
) ? 2 : 1,
510 if (am
->asla_forward
.s_addr
!= 0) {
511 if (flags
& F_DTAIL
) {
512 snprintf(get_line(0, 0),
513 get_line_remain(), " Forward %s",
514 inet_ntoa(am
->asla_forward
));
517 if (am
->asla_tag
.s_addr
!= 0) {
518 if (flags
& F_DTAIL
) {
519 snprintf(get_line(0, 0),
520 get_line_remain(), " Tag %s",
521 inet_ntoa(am
->asla_tag
));
528 if (flags
& F_DTAIL
) {
529 snprintf(get_line(0, 0), get_line_remain(),
530 " Unknown LSA type %d", lsa
->ls_hdr
.ls_type
);
540 interpret_ospf(int flags
, struct ospfhdr
*ospf
, int iplen
, int fraglen
)
543 struct lsa_hdr
*lsah
;
546 boolean_t trunc
= B_FALSE
;
548 if ((fraglen
< OSPF_MIN_HEADER_SIZE
) ||
549 (fraglen
< ntohs(ospf
->ospf_len
)))
550 return (fraglen
); /* incomplete header */
552 if (fraglen
> ntohs(ospf
->ospf_len
))
553 fraglen
= ntohs(ospf
->ospf_len
);
556 if (ospf
->ospf_type
> OSPF_TYPE_MAX
) {
558 (void) sprintf(sum_line
, "Unknown OSPF TYPE %d \n",
560 sum_line
+= strlen(sum_line
);
563 show_header("OSPF: ", "OSPF Header", fraglen
);
565 (void) snprintf(get_line(0, 0), get_line_remain(),
566 "Unknown OSPF Type = %d", ospf
->ospf_type
);
572 sum_line
= (char *)get_sum_line();
573 (void) sprintf(sum_line
, "OSPF %s RTRID=%s ",
574 ospf_types
[ospf
->ospf_type
],
575 inet_ntoa(ospf
->ospf_routerid
));
576 sum_line
+= strlen(sum_line
);
577 (void) sprintf(sum_line
, "AREA=%s LEN=%d ",
578 inet_ntoa(ospf
->ospf_areaid
),
579 ntohs((ushort_t
)ospf
->ospf_len
));
580 sum_line
+= strlen(sum_line
);
583 if (flags
& F_DTAIL
) {
584 show_header("OSPF: ", "OSPF Header", fraglen
);
586 (void) snprintf(get_line(0, 0), get_line_remain(),
587 "Version = %d", ospf
->ospf_version
);
588 (void) snprintf(get_line(0, 0), get_line_remain(),
589 "Type = %s", ospf_types
[ospf
->ospf_type
]);
590 (void) snprintf(get_line(0, 0), get_line_remain(),
591 "Router ID = %s", inet_ntoa(ospf
->ospf_routerid
));
592 (void) snprintf(get_line(0, 0), get_line_remain(),
593 "Area ID = %s", inet_ntoa(ospf
->ospf_areaid
));
594 (void) snprintf(get_line(0, 0), get_line_remain(),
595 "Checksum = 0x%x", ospf
->ospf_chksum
);
597 if (ospf
->ospf_authtype
> OSPF_AUTH_TYPE_MAX
) {
598 (void) snprintf(get_line(0, 0), get_line_remain(),
599 "Auth = %d (unknown auth type)",
600 ospf
->ospf_authtype
);
602 (void) snprintf(get_line(0, 0), get_line_remain(),
603 "Auth = %s", ospf_authtypes
[ospf
->ospf_authtype
]);
607 if (ospf
->ospf_version
!= 2) {
608 if (ospf
->ospf_version
== 3) {
610 snprintf(get_line(0, 0), get_line_remain(),
611 "ospfv3 packet in ipv4 header");
612 return (interpret_ospf6(flags
, ospf
, iplen
, fraglen
));
618 switch (ospf
->ospf_type
) {
619 case OSPF_TYPE_HELLO
:
620 if (interpret_ospf_hello(flags
, ospf
, fraglen
) < 0)
625 if (fraglen
< OSPF_MIN_HEADER_SIZE
+ OSPF_MIN_DB_HEADER_SIZE
) {
630 sprintf(sum_line
, " %s %s S %X", ospf_print_bits(
631 ospf_option_bits
, ospf
->ospf_db
.db_options
),
632 ospf_print_bits(ospf_db_flags_bits
,
633 ospf
->ospf_db
.db_flags
),
634 ntohl(ospf
->ospf_db
.db_seq
));
635 sum_line
+= strlen(sum_line
);
637 if (flags
& F_DTAIL
) {
638 show_header("OSPF DB: ", "Database Description Packet",
641 snprintf(get_line(0, 0), get_line_remain(),
642 "Options = %s", ospf_print_bits(
643 ospf_option_bits
, ospf
->ospf_db
.db_options
));
644 snprintf(get_line(0, 0), get_line_remain(),
645 "Flags = %s", ospf_print_bits(
646 ospf_db_flags_bits
, ospf
->ospf_db
.db_flags
));
647 snprintf(get_line(0, 0), get_line_remain(),
648 "Sequence = 0x%X", ntohl(ospf
->ospf_db
.db_seq
));
649 /* Print all the LS advs */
650 lsah
= ospf
->ospf_db
.db_lshdr
;
651 while ((uchar_t
*)lsah
< ((uchar_t
*)ospf
+ fraglen
)) {
652 if ((uchar_t
*)lsah
+ sizeof (struct lsa_hdr
) >
653 ((uchar_t
*)ospf
+ fraglen
)) {
657 interpret_ospf_lsa_hdr(flags
, lsah
);
664 if (fraglen
< OSPF_MIN_HEADER_SIZE
+ OSPF_MIN_LSR_HEADER_SIZE
) {
668 if (flags
& F_DTAIL
) {
669 snprintf(get_line(0, 0), get_line_remain(),
670 "Link State Request Packet");
672 lsr
= ospf
->ospf_lsr
;
673 while ((uchar_t
*)lsr
< ((uchar_t
*)ospf
+ fraglen
)) {
674 if ((uchar_t
*)lsr
+ sizeof (struct lsr
) >
675 ((uchar_t
*)ospf
+ fraglen
)) {
682 if (flags
& F_DTAIL
) {
683 ospf_print_ls_type(flags
, ntohl(lsr
->ls_type
),
684 lsr
->ls_stateid
, lsr
->ls_router
);
689 sprintf(sum_line
, " %d LSAs", nlsah
);
690 sum_line
+= strlen(sum_line
);
695 if (fraglen
< OSPF_MIN_HEADER_SIZE
+ OSPF_MIN_LSU_HEADER_SIZE
) {
699 if (flags
& F_DTAIL
) {
700 show_header("OSPF LSU: ", "Link State Update Packet",
704 lsa
= ospf
->ospf_lsu
.lsu_lsa
;
705 nlsa
= ntohl(ospf
->ospf_lsu
.lsu_count
);
707 sprintf(sum_line
, "%d LSAs", nlsa
);
708 sum_line
+= strlen(sum_line
);
711 while (nlsa
-- != 0) {
712 uchar_t
*fragend
= (uchar_t
*)ospf
+ fraglen
;
713 if (((uchar_t
*)lsa
>= fragend
) ||
714 ((uchar_t
*)lsa
+ sizeof (struct lsa_hdr
) >
716 ((uchar_t
*)lsa
+ ntohs(lsa
->ls_hdr
.ls_length
) >
722 if (interpret_ospf_lsa(flags
, lsa
, fragend
) < 0) {
726 lsa
= (struct lsa
*)((uchar_t
*)lsa
+
727 ntohs(lsa
->ls_hdr
.ls_length
));
733 if (flags
& F_DTAIL
) {
734 show_header("OSPF LSA: ", "Link State Ack Packet",
738 lsah
= ospf
->ospf_lsa
.lsa_lshdr
;
740 while ((uchar_t
*)lsah
< ((uchar_t
*)ospf
+ fraglen
)) {
741 if ((uchar_t
*)lsah
+ sizeof (struct lsa_hdr
) >
742 ((uchar_t
*)ospf
+ fraglen
)) {
748 interpret_ospf_lsa_hdr(flags
, lsah
);
752 sprintf(sum_line
, "%d LSAs", nlsah
);
753 sum_line
+= strlen(sum_line
);
763 sprintf(sum_line
, "--truncated");
764 sum_line
+= strlen(sum_line
);
767 snprintf(get_line(0, 0), get_line_remain(),