X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a13a19a61047d79e2090b7261e57f8bd595b89d2..1a04b92e365f5ed01ca38619b41bcc4fc9cbd63c:/ospf.h diff --git a/ospf.h b/ospf.h index 9d0b4c46..4dca0af3 100644 --- a/ospf.h +++ b/ospf.h @@ -147,14 +147,14 @@ * TOS metric struct (will be 0 or more in router links update) */ struct tos_metric { - uint8_t tos_type; - uint8_t reserved; - uint8_t tos_metric[2]; + nd_uint8_t tos_type; + nd_uint8_t reserved; + nd_uint16_t tos_metric; }; struct tos_link { - uint8_t link_type; - uint8_t link_tos_count; - uint8_t tos_metric[2]; + nd_uint8_t link_type; + nd_uint8_t link_tos_count; + nd_uint16_t tos_metric; }; union un_tos { struct tos_link link; @@ -163,20 +163,20 @@ union un_tos { /* link state advertisement header */ struct lsa_hdr { - uint16_t ls_age; - uint8_t ls_options; - uint8_t ls_type; + nd_uint16_t ls_age; + nd_uint8_t ls_options; + nd_uint8_t ls_type; union { struct in_addr lsa_id; struct { /* opaque LSAs change the LSA-ID field */ - uint8_t opaque_type; - uint8_t opaque_id[3]; + nd_uint8_t opaque_type; + nd_uint24_t opaque_id; } opaque_field; } un_lsa_id; struct in_addr ls_router; - uint32_t ls_seq; - uint16_t ls_chksum; - uint16_t ls_length; + nd_uint32_t ls_seq; + nd_uint16_t ls_chksum; + nd_uint16_t ls_length; }; /* link state advertisement */ @@ -187,9 +187,9 @@ struct lsa { union { /* Router links advertisements */ struct { - uint8_t rla_flags; - uint8_t rla_zero[1]; - uint16_t rla_count; + nd_uint8_t rla_flags; + nd_byte rla_zero; + nd_uint16_t rla_count; struct rlalink { struct in_addr link_id; struct in_addr link_data; @@ -206,14 +206,14 @@ struct lsa { /* Summary links advertisements */ struct { struct in_addr sla_mask; - uint32_t sla_tosmetric[1]; /* may repeat */ + nd_uint32_t sla_tosmetric[1]; /* may repeat */ } un_sla; /* AS external links advertisements */ struct { struct in_addr asla_mask; struct aslametric { - uint32_t asla_tosmetric; + nd_uint32_t asla_tosmetric; struct in_addr asla_forward; struct in_addr asla_tag; } asla_metric[1]; /* may repeat */ @@ -221,34 +221,34 @@ struct lsa { /* Multicast group membership */ struct mcla { - uint32_t mcla_vtype; + nd_uint32_t mcla_vtype; struct in_addr mcla_vid; } un_mcla[1]; /* Opaque TE LSA */ struct { - uint16_t type; - uint16_t length; - uint8_t data[1]; /* may repeat */ + nd_uint16_t type; + nd_uint16_t length; + nd_byte data[1]; /* may repeat */ } un_te_lsa_tlv; /* Opaque Grace LSA */ struct { - uint16_t type; - uint16_t length; - uint8_t data[1]; /* may repeat */ + nd_uint16_t type; + nd_uint16_t length; + nd_byte data[1]; /* may repeat */ } un_grace_tlv; /* Opaque Router information LSA */ struct { - uint16_t type; - uint16_t length; - uint8_t data[1]; /* may repeat */ + nd_uint16_t type; + nd_uint16_t length; + nd_byte data[1]; /* may repeat */ } un_ri_tlv; /* Unknown LSA */ struct unknown { - uint8_t data[1]; /* may repeat */ + nd_byte data[1]; /* may repeat */ } un_unknown[1]; } lsa_un; @@ -260,23 +260,23 @@ struct lsa { * the main header */ struct ospfhdr { - uint8_t ospf_version; - uint8_t ospf_type; - uint16_t ospf_len; + nd_uint8_t ospf_version; + nd_uint8_t ospf_type; + nd_uint16_t ospf_len; struct in_addr ospf_routerid; struct in_addr ospf_areaid; - uint16_t ospf_chksum; - uint16_t ospf_authtype; - uint8_t ospf_authdata[OSPF_AUTH_SIZE]; + nd_uint16_t ospf_chksum; + nd_uint16_t ospf_authtype; + nd_byte ospf_authdata[OSPF_AUTH_SIZE]; union { /* Hello packet */ struct { struct in_addr hello_mask; - uint16_t hello_helloint; - uint8_t hello_options; - uint8_t hello_priority; - uint32_t hello_deadint; + nd_uint16_t hello_helloint; + nd_uint8_t hello_options; + nd_uint8_t hello_priority; + nd_uint32_t hello_deadint; struct in_addr hello_dr; struct in_addr hello_bdr; struct in_addr hello_neighbor[1]; /* may repeat */ @@ -284,21 +284,21 @@ struct ospfhdr { /* Database Description packet */ struct { - uint16_t db_ifmtu; - uint8_t db_options; - uint8_t db_flags; - uint32_t db_seq; + nd_uint16_t db_ifmtu; + nd_uint8_t db_options; + nd_uint8_t db_flags; + nd_uint32_t db_seq; struct lsa_hdr db_lshdr[1]; /* may repeat */ } un_db; /* Link State Request */ struct lsr { - uint8_t ls_type[4]; + nd_uint32_t ls_type; union { struct in_addr ls_stateid; struct { /* opaque LSAs change the LSA-ID field */ - uint8_t opaque_type; - uint8_t opaque_id[3]; + nd_uint8_t opaque_type; + nd_uint24_t opaque_id; } opaque_field; } un_ls_stateid; struct in_addr ls_router; @@ -306,8 +306,8 @@ struct ospfhdr { /* Link State Update */ struct { - uint32_t lsu_count; - struct lsa lsu_lsa[1]; /* may repeat */ + nd_uint32_t lsu_count; + struct lsa lsu_lsa[1]; /* may repeat */ } un_lsu; /* Link State Acknowledgement */