X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3a4254f5c662637cf669ff66b941240d7e456d6d..ffa1470e5c7ff0e50028d085a481dc797b0b51ed:/ospf.h diff --git a/ospf.h b/ospf.h index 7652cec2..21899a00 100644 --- a/ospf.h +++ b/ospf.h @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.6 2002-12-11 07:07:25 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.16.2.1 2005-08-23 11:16:30 hannes Exp $ (LBL) */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. @@ -43,6 +43,7 @@ #define OSPF_OPTION_EA 0x10 /* EA bit: External Attribute capable */ #define OSPF_OPTION_DC 0x20 /* DC bit: Demand circuit capable */ #define OSPF_OPTION_O 0x40 /* O bit: Opaque LSA capable */ +#define OSPF_OPTION_DN 0x80 /* DN bit: Up/Down Bit capable - draft-ietf-ospf-2547-dnbit-04 */ /* ospf_authtype */ #define OSPF_AUTH_NONE 0 /* No auth-data */ @@ -63,11 +64,47 @@ #define LS_TYPE_ASE 5 /* ASE */ #define LS_TYPE_GROUP 6 /* Group membership (multicast */ /* extensions 23 July 1991) */ -#define LS_TYPE_NSSA 7 /* rfc1587 - Not so Stubby Areas */ +#define LS_TYPE_NSSA 7 /* rfc3101 - Not so Stubby Areas */ #define LS_TYPE_OPAQUE_LL 9 /* rfc2370 - Opaque Link Local */ #define LS_TYPE_OPAQUE_AL 10 /* rfc2370 - Opaque Link Local */ #define LS_TYPE_OPAQUE_DW 11 /* rfc2370 - Opaque Domain Wide */ +#define LS_OPAQUE_TYPE_TE 1 /* rfc3630 */ +#define LS_OPAQUE_TYPE_GRACE 3 /* rfc3623 */ +#define LS_OPAQUE_TYPE_RI 4 /* draft-ietf-ospf-cap-03 */ + +#define LS_OPAQUE_TE_TLV_ROUTER 1 /* rfc3630 */ +#define LS_OPAQUE_TE_TLV_LINK 2 /* rfc3630 */ + +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE 1 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID 2 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP 3 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP 4 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC 5 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW 6 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW 7 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW 8 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP 9 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID 11 /* draft-ietf-ccamp-ospf-gmpls-extensions */ +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE 14 /* draft-ietf-ccamp-ospf-gmpls-extensions */ +#define LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR 15 /* draft-ietf-ccamp-ospf-gmpls-extensions */ +#define LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP 16 /* draft-ietf-ccamp-ospf-gmpls-extensions */ +#define LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS 17 /* rfc4124 */ + +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP 1 /* rfc3630 */ +#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_MA 2 /* rfc3630 */ + +#define LS_OPAQUE_GRACE_TLV_PERIOD 1 /* rfc3623 */ +#define LS_OPAQUE_GRACE_TLV_REASON 2 /* rfc3623 */ +#define LS_OPAQUE_GRACE_TLV_INT_ADDRESS 3 /* rfc3623 */ + +#define LS_OPAQUE_GRACE_TLV_REASON_UNKNOWN 0 /* rfc3623 */ +#define LS_OPAQUE_GRACE_TLV_REASON_SW_RESTART 1 /* rfc3623 */ +#define LS_OPAQUE_GRACE_TLV_REASON_SW_UPGRADE 2 /* rfc3623 */ +#define LS_OPAQUE_GRACE_TLV_REASON_CP_SWITCH 3 /* rfc3623 */ + +#define LS_OPAQUE_RI_TLV_CAP 1 /* draft-ietf-ospf-cap-03 */ + /************************************************* * * is the above a bug in the documentation? @@ -107,12 +144,18 @@ struct lsa_hdr { u_int16_t ls_age; u_int8_t ls_options; u_int8_t ls_type; - struct in_addr ls_stateid; + union { + struct in_addr lsa_id; + struct { /* opaque LSAs change the LSA-ID field */ + u_int8_t opaque_type; + u_int8_t opaque_id[3]; + } opaque_field; + } un_lsa_id; struct in_addr ls_router; u_int32_t ls_seq; u_int16_t ls_chksum; u_int16_t ls_length; -} __attribute__((packed)); +}; /* link state advertisement */ struct lsa { @@ -162,18 +205,34 @@ struct lsa { struct in_addr mcla_vid; } un_mcla[1]; - /* Opaque LSA */ - struct opaque { - u_int8_t opaque_type; - u_int8_t opaque_id[3]; - struct in_addr adv_router; - struct in_addr sequence_num; - u_int16_t chksum; - u_int16_t length; - } un_opaque[1]; + /* Opaque TE LSA */ + struct { + u_int16_t type; + u_int16_t length; + u_int8_t data[1]; /* may repeat */ + } un_te_lsa_tlv; + + /* Opaque Grace LSA */ + struct { + u_int16_t type; + u_int16_t length; + u_int8_t data[1]; /* may repeat */ + } un_grace_tlv; + + /* Opaque Router information LSA */ + struct { + u_int16_t type; + u_int16_t length; + u_int8_t data[1]; /* may repeat */ + } un_ri_tlv; + + /* Unknown LSA */ + struct unknown { + u_int8_t data[1]; /* may repeat */ + } un_unknown[1]; } lsa_un; -} __attribute__((packed)); +}; /* @@ -183,7 +242,7 @@ struct tos_metric { u_int8_t tos_type; u_int8_t tos_zero; u_int16_t tos_metric; -} __attribute__((packed)); +}; #define OSPF_AUTH_SIZE 8 @@ -224,8 +283,14 @@ struct ospfhdr { /* Link State Request */ struct lsr { - u_int32_t ls_type; - struct in_addr ls_stateid; + u_int8_t ls_type[4]; + union { + struct in_addr ls_stateid; + struct { /* opaque LSAs change the LSA-ID field */ + u_int8_t opaque_type; + u_int8_t opaque_id[3]; + } opaque_field; + } un_ls_stateid; struct in_addr ls_router; } un_lsr[1]; /* may repeat */ @@ -240,7 +305,7 @@ struct ospfhdr { struct lsa_hdr lsa_lshdr[1]; /* may repeat */ } un_lsa ; } ospf_un ; -} __attribute__((packed)); +}; #define ospf_hello ospf_un.un_hello #define ospf_db ospf_un.un_db