📄 dymo.h
字号:
/* dymo.h */
/* Data Structures used for the Dynamic On-Demand */
/* Manet Routing Protocol (DYMO) for */
/* Mobile Ad-Hoc Networking (MANET) */
/****************************************/
/* Copyright (c) 1986-2003 */
/* by OPNET Technologies, Inc. */
/* (A Delaware Corporation) */
/* 7255 Woodmont Av., Suite 250 */
/* Bethesda, MD 20814, U.S.A. */
/* All Rights Reserved. */
/****************************************/
/* Protect against multiple includes. */
#ifndef _DYMO_H_INCLUDED_
#define _DYMO_H_INCLUDED_
#include <ip_addr_v4.h>
#include <ip_rte_v4.h>
#include <ip_cmn_rte_table.h>
#if defined (__cplusplus)
extern "C" {
#endif
/******** Constants *********/
/* Constants to access entries in the route table */
#define DYMOC_ROUTE_ENTRY_DEST_SEQ_NUM 1
#define DYMOC_ROUTE_ENTRY_VALID_SEQ_NUM_FLAG 2
#define DYMOC_ROUTE_ENTRY_ROUTE_ENTRY_STATE 3
#define DYMOC_ROUTE_ENTRY_NEXT_HOP_ADDR 4
#define DYMOC_ROUTE_ENTRY_OUT_PORT_INFO 5
#define DYMOC_ROUTE_ENTRY_HOP_COUNT 6
#define DYMOC_ROUTE_ENTRY_PRECURSOR_LIST 7
#define DYMOC_ROUTE_ENTRY_EXPIRY_TIME 8
/* Constants to identify the timers */
#define DYMOC_ROUTE_ENTRY_INVALID 1
#define DYMOC_ROUTE_ENTRY_EXPIRED 2
#define DYMOC_ROUTE_REQUEST_EXPIRY 3
#define DYMOC_HELLO_TIMER_EXPIRY 4
#define DYMOC_CONN_LOSS_TIMER 5
/* Constant to specify an infinte packet queue size */
#define DYMOC_INFINITE_PACKET_QUEUE -1
/* Constant to specify the delete period constant K */
#define DYMOC_DELETE_PERIOD_CONSTANT_K 5
/* Constant to specify an invalid destination sequence number */
#define DYMOC_DEST_SEQ_NUM_INVALID -1
/******** Enumenated Data Types *********/
/* State of the route entry in the route table */
typedef enum
{
DymoC_Undef_Route,
DymoC_Valid_Route,
DymoC_Invalid_Route
} DymoC_Route_Entry_State;
/******** Data Structures *********/
/*********************************************/
/**************** STATHANDLES ****************/
/*********************************************/
/* Local Statistic handles */
typedef struct
{
Stathandle route_discovery_time_shandle;
Stathandle num_hops_shandle;
Stathandle route_table_size_shandle;
Stathandle pkt_queue_size_shandle;
Stathandle num_pkts_discard_shandle;
Stathandle rte_traf_rcvd_bps_shandle;
Stathandle rte_traf_rcvd_pps_shandle;
Stathandle rte_traf_sent_bps_shandle;
Stathandle rte_traf_sent_pps_shandle;
Stathandle total_requests_sent_shandle;
Stathandle total_replies_sent_shandle;
Stathandle total_replies_sent_from_dest_shandle;
Stathandle total_cached_replies_sent_shandle;
Stathandle total_route_errors_sent_shandle;
Stathandle total_requests_fwd_shandle;
} DymoT_Local_Stathandles;
/* Global Statistic handles */
typedef struct
{
Stathandle num_hops_global_shandle;
Stathandle num_pkts_discard_global_shandle;
Stathandle route_discovery_time_global_shandle;
Stathandle rte_traf_rcvd_bps_global_shandle;
Stathandle rte_traf_rcvd_pps_global_shandle;
Stathandle rte_traf_sent_bps_global_shandle;
Stathandle rte_traf_sent_pps_global_shandle;
Stathandle total_requests_sent_global_shandle;
Stathandle total_replies_sent_global_shandle;
Stathandle total_replies_sent_from_dest_global_shandle;
Stathandle total_cached_replies_sent_global_shandle;
Stathandle total_route_errors_sent_global_shandle;
} DymoT_Global_Stathandles;
/*********************************************/
/**************** ROUTE TABLE ****************/
/*********************************************/
/* The route table is a hash table of route entries */
/* Each entry in the route table is indexed by the */
/* destination IP address. */
typedef struct
{
PrgT_String_Hash_Table* route_table;
IpT_Cmn_Rte_Table* ip_cmn_rte_table_ptr;
IpT_Rte_Proc_Id dymo_protocol_id;
double route_expiry_time;
double delete_period;
DymoT_Local_Stathandles* stat_handles_ptr;
int current_size;
} DymoT_Route_Table;
typedef struct
{
IpT_Dest_Prefix dest_prefix;
int dest_seq_num;
Boolean valid_dest_sequence_number_flag;
DymoC_Route_Entry_State route_entry_state;
InetT_Address next_hop_addr;
IpT_Port_Info next_hop_port_info;
int hop_count;
List* precursor_lptr;
double route_expiry_time;
Evhandle route_expiry_evhandle;
} DymoT_Route_Entry;
/*********************************************/
/*************** PACKET QUEUE ****************/
/*********************************************/
/* This table stores the list of data packets */
/* awaiting a route discovery. Each entry in */
/* the packet queue table is a list of packets */
/* to a specific destination. Each entry in the */
/* table is indexed by the destination address */
typedef struct
{
PrgT_String_Hash_Table* pkt_queue_table;
int max_queue_size;
int current_queue_size;
DymoT_Local_Stathandles* stat_handle_ptr;
} DymoT_Packet_Queue;
/* Each entry in the list contains the data */
/* packet and the insert time of the packet. */
/* If the queue reaches its maximum size, the */
/* oldest packet in the queue is discarded */
typedef struct
{
Packet* pkptr;
double insert_time;
} DymoT_Packet_Entry;
/*********************************************/
/*********** ROUTE REQUEST TABLE *************/
/*********************************************/
/* The request table stores information about */
/* route requests originated or forwarded by a */
/* node. This is done so that duplicate */
/* reception of route requests can be discarded */
/* The table is indexed by the originator IP */
/* address of the route request and contains a */
/* list of request entries */
typedef struct
{
PrgT_String_Hash_Table* orig_request_table;
PrgT_String_Hash_Table* forward_request_table;
double forward_request_expiry_time;
int max_rreq_retries;
} DymoT_Request_Table;
typedef struct
{
InetT_Address target_address;
int request_id;
double insert_time;
double current_request_expiry_time;
Evhandle rreq_expiry_evhandle;
int current_ttl_value;
int num_retries;
InetT_Address src_address;
} DymoT_Orig_Request_Entry;
typedef struct
{
int request_id;
double insert_time;
} DymoT_Forward_Request_Entry;
typedef struct
{
InetT_Address orig_addr;
int request_id;
} DymoT_Request_Expiry;
/*********************************************/
/************ CONNECTIVITY TABLE *************/
/*********************************************/
/* The connectivity table stores the list of */
/* neighbor nodes from which it has received */
/* a hello message or any other packet. This is */
/* to determine the connectivity to each of its */
/* neighbor nodes. */
/* The connectivity table is a hash table */
/* indexed by the neighbor IP address. Each */
/* entry in the table contains the connectivity */
/* information of the neighbor. */
typedef struct
{
InetT_Address neighbor_address;
double last_pkt_received_time;
double last_hello_received_time;
Evhandle conn_expiry_handle;
} DymoT_Conn_Info;
#if defined (__cplusplus)
} /* end of 'extern "C" {' */
#endif
/* End if for protection against multiple includes. */
#endif /*_DYMO_H_INCLUDED_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -