⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcast.h

📁 基于linux环境的ns2多机并行仿真补丁
💻 H
字号:
/*---------------------------------------------------------------------------*//* Mcast interface.                                                          *//* Author(s): Richard Fujimoto.                                              *//* $Revision: 1.5 $ $Name: v26apr05 $ $Date: 2003/12/12 20:04:17 $ *//*---------------------------------------------------------------------------*/#ifndef __MCAST_H#define __MCAST_H#include "fm.h"/* * Transportation categories */#define MCAST_RELIABLE		0#define MCAST_BEST_EFFORT	1/* * Configration constants *//* maximum number of times to retry to obtain a send stream (>= 0) */#define MCAST_MAXRETRY	0/* maximum number of multicast groups owned by a single processor */#define MCAST_MAX_GROUPS_PER_PE   4096 /*CUSTOMIZE*//* maximum number of groups a single PE can subscribe to */#define MCAST_MAX_SUBS_PER_PE   4096 /*CUSTOMIZE*//* average number of subscriptions a PE will make to each group */#define MCAST_AVG_SUBS_PER_GROUP   16/* maximum number of subscription records */#define MCAST_MAX_SUB_RECORDS (MCAST_MAX_SUBS_PER_PE * MCAST_AVG_SUBS_PER_GROUP)/* size of hash table for group names on each PE */#define MCAST_NAME_TBL_SIZE MCAST_MAX_GROUPS_PER_PE/* maximum length of a multicast group name */#define MCAST_MAX_NAME_LEN 128/* average number of processors subscribed to a group */#define MCAST_AVG_PES_PER_GROUP	8/* maximum number of processor subscription records */#define MCAST_MAX_DST_RECORDS  (MCAST_AVG_PES_PER_GROUP*MCAST_MAX_GROUPS_PER_PE)/* handle cache parameters */#define MCAST_HCACHE_SIZE       512#define MCAST_HCACHE_OV_SIZE    1024/* * Error Codes *//* successful completion */#define MCAST_Success 0#define MCAST_SUCCESS 0/* couldn't allocate memory */#define MCAST_MemoryError 1#define MCAST_MEMORYERROR 1/* duplicate name in creating groups */#define MCAST_DuplicateName 2#define MCAST_DUPLICATENAME 2/* name passed as a paramter is too long */#define MCAST_NameTooLong 3#define MCAST_NAMETOOLONG 3/* couldn't find requested group */#define MCAST_NoGroup 4#define MCAST_NOGROUP 4/* an internal table overflow occurred */#define MCAST_TableFull 5#define MCAST_TABLEFULL 5/* some internal inconsistency with multicast tables detected */#define MCAST_SubError 6#define MCAST_SUBERROR 6/* could not find a particular subscription */#define MCAST_SubNotFound 7#define MCAST_SUBNOTFOUND 7/* making a subscription, but WhereProc not set yet */#define MCAST_NoWhereProc 8#define MCAST_NOWHEREPROC 8/* * Type definitions */typedef struct MCAST_HandleS *   MCAST_Handle;/* Message Handler Procedure *//* parameters: pointer to message, message size, context, message type */typedef void (*MCAST_HandleProc)(void *, long, void *, long);/* WhereProc procedure to allocate memory for incoming messages *//* parameters: message Size in bytes, context, user defined message type */typedef char *(*MCAST_WhereProc) (long, void *, long);/* EndProc procedure called after processing handlers *//* parameters: pointer to message, message size, context, message type */typedef void (*MCAST_EndProc)(void *, long, void *, long);typedef void    *MCAST_Addr;/* * Useful definitions *//* node number for this processor (0, 1, 2, ...) */#define MCAST_nodeid FM_nodeid/* number of processors */#define MCAST_numnodes FM_numnodes/* * Procedures */void MCAST_Init (void);long MCAST_Create (const char *, MCAST_Handle *, long);long MCAST_CreateP (const char *, MCAST_Handle *, ULONG, long);long MCAST_GetHandle (const char *, MCAST_Handle *);long MCAST_Subscribe (MCAST_Handle, MCAST_HandleProc, void *, long *);long MCAST_NLocalSubscriptions (MCAST_Handle);long MCAST_UnSubscribe (MCAST_Handle, long);long MCAST_SetWhereProc (MCAST_Handle, MCAST_WhereProc, void *);long MCAST_SetEndProc(MCAST_Handle, MCAST_EndProc, void *);void MCAST_Send (MCAST_Handle, void *, ULONG, ULONG, long *);MCAST_Addr MCAST_GetMsg(void);void MCAST_ReturnBuffer (MCAST_Addr);void MCAST_PrintNameTbl();void MCAST_PrintDstTbl();void MCAST_PrintSubTbl();void MCAST_Barrier();void MCAST_FlushBarrier();void MCAST_PrintLocalStats(void);void MCAST_Tick(void);const char *MCAST_GetName(MCAST_Handle); /*KALYAN*/int MCAST_SameGroups(MCAST_Handle, MCAST_Handle); /*KALYAN*/void MCAST_GetMembers(MCAST_Handle h, int *num, int pes[], int maxn); /*KALYAN*/#endif /*__MCAST_H*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -