📄 ospf_structures.h
字号:
{ BYTE version; /* set to 2 for this implementation */ BYTE_ENUM(OSPF_UNION_PACKET_TYPES) type; /* length of entire OSPF protocol packet in bytes, including the standard OSPF * header */ USHORT length; /* identity of the router originating the packet */ ULONG router_id; /* a 32 bit number identifying the area this packet belongs to */ ULONG area_id; /* checksum of the entire contents of the packet starting with the OSPF packet header * but excluding the 64 bit authentication field */ USHORT checksum; USHORT authentication_type; UNION_OSPF_AUTHENTICATION_FIELD authentication_field; /* a 64 bit field for use by the authentication scheme */ UNION_OSPF_PACKET_TYPES rest_of_packet;} _pack OSPF_HEADER;typedef _struct OSPF_PACKET{ struct ip ip_header; OSPF_HEADER header;} _pack OSPF_PACKET;typedef struct OSPF_LS_DATABASE_SUMMARY{ struct OSPF_LS_DATABASE_SUMMARY *sptr_forward_link; struct OSPF_LS_DATABASE_SUMMARY *sptr_backward_link; OSPF_HEADER *sptr_ospf_header; USHORT size_of_packet; /* length of this packet including ospf header size */ USHORT number_of_database_entries;} OSPF_LS_DATABASE_SUMMARY;typedef struct OSPF_LS_REQUEST{ struct OSPF_LS_REQUEST *sptr_forward_link; struct OSPF_LS_REQUEST *sptr_backward_link; ULONG id; ULONG advertising_router; seq_t sequence_number; USHORT checksum; USHORT age;} OSPF_LS_REQUEST;typedef union UNION_OSPF_LINK_STATE_ADVERTISEMENT{ struct OSPF_ROUTER_LINK_ADVERTISEMENT_HEADER *sptr_router; struct OSPF_NETWORK_LINK_ADVERTISEMENT_HEADER *sptr_network; struct OSPF_SUMMARY_LINK_ADVERTISEMENT_HEADER *sptr_summary; struct OSPF_EXTERNAL_LINK_ADVERTISEMENT_HEADER *sptr_external; struct OSPF_TYPE_7_LINK_ADVERTISEMENT_HEADER *sptr_type_7; /*opaque lsa structure for opaque lsas jkw*/ struct OSPF_TYPE_9_LINK_ADVERTISEMENT_HEADER *sptr_type_9; struct OSPF_TYPE_10_LINK_ADVERTISEMENT_HEADER *sptr_type_10; struct OSPF_TYPE_11_LINK_ADVERTISEMENT_HEADER *sptr_type_11;} UNION_OSPF_LINK_STATE_ADVERTISEMENT;/****************************//* Routing Table Structures *//****************************/typedef struct OSPF_NEXT_HOP_BLOCK{ struct OSPF_NEXT_HOP_BLOCK *sptr_forward_link; struct OSPF_NEXT_HOP_BLOCK *sptr_backward_link; ULONG outgoing_router_interface; ULONG next_hop_router; enum OSPF_ROUTE_STATUS route_status;} OSPF_NEXT_HOP_BLOCK;typedef struct OSPF_ROUTING_TABLE_ENTRY{ enum OSPF_ROUTE_DESTINATION_TYPE destination_type; ULONG destination_id; ULONG address_mask; BYTE_ENUM (BOOLEAN) type_5_route_originated; UNION_OSPF_OPTIONS optional_capabilities; UNION_SERVICE_TYPE_BIT_STRUCTURE type_of_service; struct OSPF_AREA_ENTRY *sptr_area; enum OSPF_ROUTE_PATH_TYPE path_type; ULONG path_cost; ULONG type2_cost; ULONG link_state_id; ULONG cached_ip_address; BYTE_ENUM (OSPF_LS_TYPE) link_type; UNION_OSPF_LINK_STATE_ADVERTISEMENT *sptr_link_state_origin; OSPF_NEXT_HOP_BLOCK *sptr_next_hop; ULONG advertising_router; ULONG abr;} OSPF_ROUTING_TABLE_ENTRY;typedef struct OSPF_ROUTING_TABLE_NODE{ struct OSPF_ROUTING_TABLE_NODE *sptr_forward_link; struct OSPF_ROUTING_TABLE_NODE *sptr_backward_link; BYTE_ENUM (BOOLEAN) active_areas_discarded_entry; /* discard_entry */ enum OSPF_ROUTE_STATUS route_node_status; OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry;} OSPF_ROUTING_TABLE_NODE;typedef union UNION_OSPF_VIRTUAL_ROUTE{ OSPF_ROUTING_TABLE_ENTRY *sptr_ospf_route;} UNION_OSPF_VIRTUAL_ROUTE;/* SPR 88619 start */typedef struct OSPF_LSA_TIMESTAMP_PER_INTERFACE_LIST{ struct OSPF_LSA_TIMESTAMP_PER_INTERFACE_LIST *sptr_forward_link; struct OSPF_LSA_TIMESTAMP_PER_INTERFACE_LIST *sptr_backward_link; ULONG if_index; ULONG neighbor_id; ULONG timestamp;} OSPF_LSA_TIMESTAMP_PER_INTERFACE_LIST;/* SPR 88619 end */typedef struct OSPF_LS_DATABASE_ENTRY{ struct OSPF_LS_DATABASE_ENTRY *sptr_forward_link; struct OSPF_LS_DATABASE_ENTRY *sptr_backward_link; UNION_OSPF_LINK_STATE_ADVERTISEMENT advertisement; UNION_OSPF_VIRTUAL_ROUTE *vptr_route; /* may point to a routing table entry or an * area boarder router */ OSPF_ROUTING_TABLE_ENTRY *sptr_database_autonomous_system_border_router; /* if it is ASB Router */ struct OSPF_LS_DATABASE_ENTRY *sptr_database_border_router; /* sum or ase - ls_database of border rtr */ struct OSPF_AREA_ENTRY *sptr_ls_database_area; /* for keeping count of db's in each area */ USHORT ls_database_hash; /* this db's hash */ enum OSPF_LS_TYPE ls_database_type; OSPF_NEXT_HOP_BLOCK *sptr_next_hop; ULONG ls_database_time_stamp; /* for keeping age - stamped when arrived */ ULONG ls_database_last_originated_time_stamp; /* for sending database copy back */ /* HME Fix SPR#75796 ANVL 37.1 Begin*/ ULONG lock_time_MinLSInterval; /* amount of delay or loc-time required before the advertisement can be flood out of eligible interfaces */ /* HME Fix SPR#75796 ANVL 37.1 End*/ struct OSPF_NEIGHBOR_LIST *sptr_ls_database_retrans; /* neighbors pointing to this ls_database */ enum OSPF_SEQUENCE_STATE ls_database_sequence_state; BYTE_ENUM (BOOLEAN) ls_database_freeme; /* flag to free this ls_database entry */ /* SPR 85050 */ /* asr: Changed route_proto to route_protocol as route_proto has conflicts in virtual stack builds */ ULONG route_protocol; /* Used for external route */ /* SPR 85893 --Begin */ BYTE_ENUM (BOOLEAN) ls_database_pending_delete; /* flag to indicate the entry is deleted from the db *//* SPR 88619 start */ OSPF_LSA_TIMESTAMP_PER_INTERFACE_LIST *sptr_lsa_retransmit_timestamps_per_neighbor;/* SPR 88619 end */ /* SPR 85893 --End */} OSPF_LS_DATABASE_ENTRY;typedef struct OSPF_LS_DATABASE_NODE{ struct OSPF_LS_DATABASE_NODE *sptr_forward_link; struct OSPF_LS_DATABASE_NODE *sptr_backward_link; OSPF_LS_DATABASE_ENTRY *sptr_ls_database_entry; ULONG periodic_retransmit_time_counter; BYTE_ENUM (BOOLEAN) flood; /* true if flooding this one */} OSPF_LS_DATABASE_NODE;typedef struct OSPF_DATABASE_INFORMATION_STRUCTURE /* used in ospf_flood.c */{ BYTE_ENUM (BOOLEAN) found_link_state_advertisement_in_database; OSPF_LS_DATABASE_ENTRY *sptr_database_entry; struct OSPF_INTERFACE *sptr_interface; struct OSPF_NEIGHBOR *sptr_neighbor; UNION_OSPF_LINK_STATE_ADVERTISEMENT new_advertisement; ULONG time_difference; ULONG source_address; ULONG destination_address;} OSPF_DATABASE_INFORMATION_STRUCTURE;typedef struct OSPF_NEIGHBOR{ struct OSPF_NEIGHBOR *sptr_forward_link; struct OSPF_NEIGHBOR *sptr_backward_link; struct OSPF_INTERFACE *sptr_interface; enum OSPF_NEIGHBOR_STATE state; ULONG events; /* Number of state changes */ ULONG last_hello; /* Time last hello was received from this neighbor */ ULONG periodic_inactivity_time_counter; BYTE_ENUM (BOOLEAN) inactivity_timer_enabled; enum OSPF_NEIGHBOR_MODE mode; /* Master or slave mode */ UNION_OSPF_FLAGS flags; /* For passing initialize, more and master/slave bits */ UNION_OSPF_OPTIONS options; seq_t database_description_sequence_number; ULONG cryptographic_sequence_number; /* Used when Cryptographic Authentication is employed */ ULONG last_exchange; /* Time last exchange was received from this neighbor - hold timer */ ULONG periodic_slave_hold_time_counter; ULONG id; USHORT priority; /* 0 means not eligible to become the Designated Router */ ULONG address; ULONG designated_router; ULONG backup_designated_router; OSPF_LS_DATABASE_NODE *sptr_retransmit; /* Link state advertisements waiting for acknowledgements */ OSPF_LS_DATABASE_SUMMARY *sptr_database_summary; /* Database summary packets that make up area database */ OSPF_LS_REQUEST *sptr_ls_request[OSPF_LS_MAX]; /*SPR 81628: Should not use a hardcoded number */ USHORT retransmit_queue_count; USHORT database_summary_queue_count; USHORT ls_request_queue_count; BYTE_ENUM (BOOLEAN) ls_request_list_has_changed; ULONG mib_address_less_index; BYTE_ENUM (BOOLEAN) mib_nbma_status; BYTE_ENUM (BOOLEAN) mib_nbma_permanence; BYTE_ENUM (BOOLEAN) mib_hello_suppressed; ULONG mib_area_id; enum BOOLEAN opaque_capability;} OSPF_NEIGHBOR;typedef struct OSPF_DESIGNATED_ROUTER_NODE{ ULONG id; ULONG address; enum OSPF_NEIGHBOR_STATE state; USHORT priority; /* 0 means not eligible to become the Designated Router */} OSPF_DESIGNATED_ROUTER_NODE;typedef _struct OSPF_AUTHENTICATION{ USHORT type; /* Type of authentication */ BYTE key_or_plain_text_passwd[OSPF_AUTHENTICATION_SIZE]; /* Authentication */} _pack OSPF_AUTHENTICATION;typedef struct OSPF_AUTHENTICATION_KEY{ struct OSPF_AUTHENTICATION_KEY *sptr_forward_link; struct OSPF_AUTHENTICATION_KEY *sptr_backward_link; BYTE key_ID; BYTE md5_16byte_password[OSPF_AUTHENTICATION_MD5_SIZE]; ULONG key_start_accept; /* time router will start accepting packets created with given key */ ULONG key_start_generate; /* time router will start using key for packet generation */ ULONG key_stop_generate; /* time router will stop using key for packet generation */ ULONG key_stop_accept; /* time router will stop accepting packets created with given key */} OSPF_AUTHENTICATION_KEY;#if (_BYTE_ORDER == _LITTLE_ENDIAN )typedef _struct OSPF_INTERFACE_FLAGS{ BIT_FIELD (enum, BOOLEAN) network_scheduled:1; /* When designated router: semaphore for generating link state advertisements */ BIT_FIELD (enum, BOOLEAN) enable:1; /* Interface is enabled */ BIT_FIELD (enum, BOOLEAN) build_network:1; /* Flag to build_net_lsa */ BIT_FIELD (enum, BOOLEAN) neighbor_change:1; /* Schedule neighbor change */ BIT_FIELD (enum, BOOLEAN) multicast:1; /* Interface is multicast capable */ BIT_FIELD (enum, BOOLEAN) cost_set:1; /* Cost was manually configured */ BIT_FIELD (enum, BOOLEAN) secondary_authentication:1; /* Secondary authentication key */ BIT_FIELD (enum,BOOLEAN) not_used:1;} _pack OSPF_INTERFACE_FLAGS;#else /* _BYTE_ORDER == _BIG_ENDIAN */typedef _struct OSPF_INTERFACE_FLAGS{ BIT_FIELD (enum,BOOLEAN) not_used:1; BIT_FIELD (enum, BOOLEAN) secondary_authentication:1; /* Secondary authentication key */ BIT_FIELD (enum, BOOLEAN) cost_set:1; /* Cost was manually configured */ BIT_FIELD (enum, BOOLEAN) multicast:1; /* Interface is multicast capable */ BIT_FIELD (enum, BOOLEAN) neighbor_change:1; /* Schedule neighbor change */ BIT_FIELD (enum, BOOLEAN) build_network:1; /* Flag to build_net_lsa */ BIT_FIELD (enum, BOOLEAN) enable:1; /* Interface is enabled */ BIT_FIELD (enum, BOOLEAN) network_scheduled:1; /* When designated router: semaphore for generating link state advertisements */} _pack OSPF_INTERFACE_FLAGS;#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */typedef _union UNION_OSPF_INTERFACE_FLAGS{ OSPF_INTERFACE_FLAGS _bit; BYTE _byte;} _pack UNION_OSPF_INTERFACE_FLAGS;typedef struct OSPF_LS_HEADER_QUEUE{ struct OSPF_LS_HEADER_QUEUE *sptr_forward_link; struct OSPF_LS_HEADER_QUEUE *sptr_backward_link;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -