dsr_support.h
来自「afit的ad hoc路由协议源码」· C头文件 代码 · 共 80 行
H
80 行
///////////////////////////////////////////////////////////////////////////
////////////// OPNET'S DSR MODEL SUPPORT PACKAGE HEADER FILE /////////////////////////////////////////////////////////////////////////////////////////
///
/// Contains: A support for the address assignations in the nist dsr model///
/// Company: National Institute of Standards and Technology
/// Written by: Xavier Pallot
/// Date: 10/10/00
///
///////////////////////////////////////////////////////////////////////////
/// Description: This file provides a support to the nist dsr models./// It is used in order to check that the dsr addresses /// assigned manually to the nodes are valids, or to assign /// them automatically///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
#ifndef DSR_SUPPORT
#define DSR_SUPPORT///////////////////////////////////////////////////////////////////////////
///////////////////////////////// INCLUDE /////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#include <opnet.h>
#include "fifo.h"///////////////////////////////////////////////////////////////////////////
///////////////////////////// TYPE DEFINITION /////////////////////////////
///////////////////////////////////////////////////////////////////////////
// constant definition#define DSR_SUPPORT_USE_THE_MAC_ADDRESS -1#define DSR_SUPPORT_AUTOMATIC_ASSIGNATION -2// structure used to store the addresses of a nodetypedef struct { int dsr_address; // the dsr address of the node int mac_address; // the mac address of the node } sAddresses;///////////////////////////////////////////////////////////////////////////
///////////////////////////// FUNCTIONS HEADER ////////////////////////////
///////////////////////////////////////////////////////////////////////////
// to start the dsr support packageextern void dsr_support_start();// to declare a new node using the dsr model to the dsr support packageextern int dsr_support_declare_node_addresses(Objid node_objid, int dsr_address, int mac_address);// to validate (check the validity) all the dsr addresses used in the networkextern int dsr_support_validate_addresses();// to know the number of nodes using the dsr model in the networkextern int dsr_support_number_of_nodes();// to get the objid of a node from its dsr addressextern int dsr_support_get_node_objid(int dsr_address);// to get the mac address of a node from its dsr addressextern int dsr_support_get_mac_from_dsr_address(int dsr_address);// to get the mac address of a node from its objidextern int dsr_support_get_mac_address(Objid node_objid);// to get the dsr address of a node from its objidextern int dsr_support_get_dsr_address(Objid node_objid);// to close the dsr supportextern void dsr_support_end();///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?