亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? distnodelib.c

?? vxworks的源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* distNodeLib - node library (VxFusion option) *//* Copyright 1999 - 2002 Wind River Systems, Inc. *//*modification history--------------------01q,15apr02,jws  fix SPR74878 (not locking node database properly)01p,23oct01,jws  fix compiler warnings (SPR 71117)01o,04oct01,jws  final fixes for SPR 3477001n,27sep01,p_r  Fixes for SPR#3477001m,11jun99,drm  Changing unicast piggy-backing default to FALSE.01l,24may99,drm  added vxfusion prefix to VxFusion related includes01k,11sep98,drm  added #include to pick up distPanic()01j,12aug98,drm  added #include stmt for distObjTypeP.h01i,08aug98,drm  added code to set broadcast flag when sending broadcast msgs01h,08apr98,ur   made `piggy backing' switchable with distNodeCtl()01g,13mar98,ur   added support for multiple crashed and operational hooks01f,29jan98,ur   added support for sending negative acknowledgments01e,23jan98,ur   bug fixed in the delivery of reassembled packets01d,20jan98,ur   splited distNodeInit() in two parts01c,19jan98,ur   bug fixed in distNodePktAck()01b,16jan98,ur   XACK contains state of sending node01a,10jun97,ur   written.*//*DESCRIPTIONThis library contains the node database, and routines to handle it.For every node in the system, one entry should be placed in the database.The database knows about the state of the node (as it looks from the localnode) and about communication between the local node and the remote one.INTERNALThe semaphore <distNodeDbSem> is used to lock the node database.  Thedatabase is a hash table of nodes in the system.  Packets chained forinput/output are part of each node's entry.  The table must be lockedwhen entering an entry.  It is also locked when finding and entry, althoughit is not clear that this is necessary because entries are never removed.The DIST_NODE_COMM structures are the packet queues.  The database mustbe locked when dealing with these structures.  It is believed that thisis now true.  Because of the way the communications routines are called,<distNodeDbSem> is now a mutex, and is sometimes called recursively.AVAILABILITYThis module is distributed as a component of the unbundled distributedmessage queues option, VxFusion.*/#include "vxWorks.h"#undef  DIST_DIAGNOSTIC   /* defining this seems to break VxFusion! */#undef  DIST_DIAGNOSTIC_SHOW#if defined (DIST_NODE_REPORT) \ || defined (DIST_DIAGNOSTIC) \ || defined (DIST_DIAGNOSTIC_SHOW)#include "stdio.h"#endif#include "stdlib.h"#include "hashLib.h"#include "semLib.h"#include "taskLib.h"#include "string.h"#include "errnoLib.h"#include "netinet/in.h"#include "private/distObjTypeP.h"#include "vxfusion/distLib.h"#include "vxfusion/distIfLib.h"#include "vxfusion/distNodeLib.h"#include "vxfusion/distStatLib.h"#include "vxfusion/private/distLibP.h"#include "vxfusion/private/distNodeLibP.h"#include "vxfusion/private/distTBufLibP.h"#include "vxfusion/private/distPktLibP.h"/* defines *//* make two macros look like macros */#define DIST_NODE_DB_LOCK    distNodeDbLock()#define DIST_NODE_DB_UNLOCK  distNodeDbUnlock()#define UNUSED_ARG(x)  if(sizeof(x)) {} /* to suppress compiler warnings *//* test if b is within [a,c) */#define winWithin(a, b, c) \    (((a <= b) && (b < c)) || ((c < a) && (a <= b)) || ((b < c) && (c < a)))/* add a to b and fold it back */#define winAdd(a, b) \    (((a) + (b)) & (DIST_IF_RNG_BUF_SZ - 1))/* sub a by b and fold it back */#define winSub(a, b) \    (((a) - (b)) & (DIST_IF_RNG_BUF_SZ - 1))#define KEY_ARG              65537        /* used by hash function */#define KEY_CMP_ARG          0            /* unused */#define DIST_NODE_MAX_HOOKS  8/* global variables */DIST_NODE_ID distNodeLocalId;   /* windSh needs this global *//* * The semaphore used to be binary, but is now initialized as mutex. * It cannot be changed back, because it is sometimes taken recursively, * and will block if not mutex. */SEM_ID       distNodeDbSem;     /* Should be taken before DIST_TBUF_FREEM *//* local variables */LOCAL HASH_ID     distNodeDbId;LOCAL BOOL        distNodeLibInstalled = FALSE;LOCAL int        distNodeNumNodesAll = 0;LOCAL int        distNodeNumNodesAlive = 0;LOCAL int        distNodeNumNodesOperational = 0;LOCAL int        distNodeLocalState;LOCAL DIST_NODE_ID    distNodeGodfatherId;LOCAL FUNCPTR        distNodeOperationalHook[DIST_NODE_MAX_HOOKS];LOCAL FUNCPTR        distNodeCrashedHook[DIST_NODE_MAX_HOOKS];LOCAL int        distNodeMaxRetries = DIST_NODE_MAX_RETRIES;LOCAL int        distNodeRetryTimeout = DIST_NODE_RETRY_TIMEOUT;LOCAL BOOL        distNodeSupportNACK = TRUE;   /* negative acknowlege */LOCAL BOOL        distNodeSupportPBB = FALSE;   /* piggy backing broadcast */LOCAL BOOL        distNodeSupportPBU = FALSE;   /* piggy backing unicast *//* local prototypes */LOCAL DIST_NODE_DB_NODE * distNodeFindById (DIST_NODE_ID nodeId);LOCAL BOOL   distNodeHCmp (DIST_NODE_DB_NODE *pMatchNode,                           DIST_NODE_DB_NODE *pHNode,                           int keyArg);LOCAL BOOL   distNodeHFunc (int elements, DIST_NODE_DB_NODE *pHNode,                            int keyArg);LOCAL STATUS distNodePktResend (DIST_NODE_COMM *pComm,                                DIST_TBUF_HDR *pTBufHdr);LOCAL void   distNodeDBTimerTask (void);LOCAL void   distNodeDBTimer (void);LOCAL BOOL   distNodeDBNodeTimer (DIST_NODE_DB_NODE *pNode,                                  DIST_NODE_BTIMO *pBtimo);LOCAL void   distNodeDBCommTimer (DIST_NODE_DB_NODE *pNode,                                  DIST_NODE_BTIMO *pBtimo,                                  BOOL isBroadcastComm);LOCAL STATUS distNodeSendNegAck (DIST_NODE_DB_NODE *pNode,                                 short id,                                 short seq);LOCAL STATUS distNodeSendAck (DIST_NODE_DB_NODE *pNode,                              int ackBroadcast,                              int options);LOCAL void   distNodeCleanup (DIST_NODE_DB_NODE *pNode);LOCAL void   distNodeSetState (DIST_NODE_DB_NODE *pNode,                               int state);LOCAL STATUS distNodeSendBootstrap (DIST_NODE_ID dest,                                    int type,                                    int timeout);#if defined(DIST_DIAGNOSTIC) || defined(DIST_DIAGNOSTIC_SHOW)LOCAL BOOL         distNodeNodeShow (DIST_NODE_DB_NODE *pNode,                                     int dummy);LOCAL const char * distNodeStateToName (int state);#endif/***************************************************************************** distNodeLibInit - initialize this module (VxFusion option)** This routine currently does nothing.** AVAILABILITY* This routine is distributed as a component of the unbundled distributed* message queues option, VxFusion.** RETURNS: N/A* NOMANUAL*/void distNodeLibInit (void)    {    }/***************************************************************************** distNodeInit - initializes the node library (VxFusion option)** This routine initializes the node database. The database can handle* up to 2^<sizeLog2> entries.** AVAILABILITY* This routine is distributed as a component of the unbundled distributed* message queues option, VxFusion.** RETURNS: OK, if successful.* NOMANUAL*/STATUS distNodeInit    (    int sizeLog2   /* init database with 2^^sizeLog2 entries */    )    {    int    hashTblSizeLog2;    int    i, tid;    if (sizeLog2 < 1)        return (ERROR);    if (distNodeLibInstalled == TRUE)        return (OK);    for (i = 0; i < DIST_NODE_MAX_HOOKS; i++)        {        distNodeOperationalHook[i] = NULL;        distNodeCrashedHook[i] = NULL;        }    distNodeLocalState = DIST_NODE_STATE_BOOT;    /* Initialize the node database. */    if (hashLibInit () == ERROR)        return (ERROR);    /* hashLibInit() failed */    hashTblSizeLog2 = sizeLog2 - 1;    distNodeDbId = hashTblCreate (hashTblSizeLog2, distNodeHCmp,            distNodeHFunc, KEY_ARG);    if (distNodeDbId == NULL)        return (ERROR);    /* hashTblCreate() failed */#ifdef UNDEFINED    distNodeDbSem = semBCreate (SEM_Q_PRIORITY, SEM_FULL) ; #else    distNodeDbSem = semMCreate (SEM_Q_PRIORITY + SEM_INVERSION_SAFE) ; #endif    /* Get the node database manager running. */    tid = taskSpawn ("tDiNodeMgr",                     DIST_NODE_MGR_PRIO,                     VX_SUPERVISOR_MODE | VX_UNBREAKABLE,                     DIST_NODE_MGR_STACK_SZ,                     (FUNCPTR) distNodeDBTimerTask,                     0, 0, 0, 0, 0, 0, 0, 0, 0, 0);    if (tid == ERROR)        return (ERROR);    /* taskSpawn() failed */    distNodeGodfatherId = DIST_IF_BROADCAST_ADDR;    /*     * Add a virtual broadcast node.     * State information (sliding windows, etc.) for outgoing broadcasts     * must be handled at a centralized place. This is the virtual     * broadcast node.     * State information for incoming broadcasts is managed within     * the broadcast communication substructure for the corresponding     * node. When a note enters the incorporation phase, all other     * nodes in the system get aware of it and update their node     * databases.     */    if (distNodeCreate (DIST_IF_BROADCAST_ADDR, DIST_NODE_STATE_OPERATIONAL)         ==        NULL)        {        return (ERROR);        }            distNodeLibInstalled = TRUE;    return (OK);    }/***************************************************************************** distNodeHCmp - compare function for hashing in node DB (VxFusion option)** This routine is the hash compare function for node IDs.** AVAILABILITY* This routine is distributed as a component of the unbundled distributed* message queues option, VxFusion.** RETURNS: True, if node IDs match.* NOMANUAL*/LOCAL BOOL distNodeHCmp    (    DIST_NODE_DB_NODE * pMatchNode, /* first node */    DIST_NODE_DB_NODE * pHNode,     /* second node */    int                 keyArg      /* unused arg */    )    {    DIST_NODE_ID  distNodeId1 = pMatchNode->nodeId;    DIST_NODE_ID  distNodeId2 = pHNode->nodeId;        UNUSED_ARG(keyArg);    return (distNodeId1 == distNodeId2);    }/***************************************************************************** distNodeHFunc - hash function for node DB (VxFusion option)** This is the hash function for node IDs.** AVAILABILITY* This routine is distributed as a component of the unbundled distributed* message queues option, VxFusion.** RETURNS: A hash index.* NOMANUAL*/LOCAL BOOL distNodeHFunc    (    int                 elements,  /* size of hash table */    DIST_NODE_DB_NODE * pHNode,    /* node whose ID to hash */    int                 divisor    /* used by hash computation */    )    {    return ((pHNode->nodeId % divisor) & (elements - 1));    }/***************************************************************************** distNodeCtl - control function for node database (VxFusion option)** This routine performs a control function on the node database.* The following functions are accepted:* \is* \i DIST_CTL_RETRY_TIMEOUT* Set send-timeout in ticks to start with. When no ACK is received* within the timeout, the packet is resent. The timeout for the* <n>th sending is: <n> * DIST_CTL_RETRY_TIMEOUT .* \i DIST_CTL_MAX_RETRIES* Set a limit for number of retries, when sending fails.* \i DIST_CTL_GET_LOCAL_ID* Get local node id.* \i DIST_CTL_GET_LOCAL_STATE* Get state of local node.* \i DIST_CTL_NACK_SUPPORT* Negative acknowledges (NACKs) are used for requesting a resend of a single* missing fragment from a packet. NACKs are sent immediately after a* fragment is found to be missing.* If <arg> is FALSE (0), the sending of negative acknowledges is disabled.* If <arg> is TRUE (1), sending of NACKs is enabled. This is the default.* \i DIST_CTL_PGGYBAK_UNICST_SUPPORT* If this is enabled, the system waits a version dependent time until it* sends an acknowledge for a previously received packet.* If a data packet is sent to* the acknowledge awaiting host in meantime, the acknowlege is delivered* in that packet. This switch turns on/off piggy backing for unicast* communication only.* If <arg> is FALSE (0), piggy backing is disabled.* If <arg> is TRUE (1), piggy backing is enabled.* Piggy backing is enabled for unicast communication by default.* \i DIST_CTL_PGGYBAK_BRDCST_SUPPORT* If this is enabled, the system waits* a version dependent time until it sends an* acknowledge for a previously received packet. If a data packet is sent to* the acknowledge awaiting host in meantime, the acknowlege is delivered* in that packet. This switch turns on/off piggy backing for broadcast* communication only.* If <arg> is FALSE (0), piggy backing is disabled.* If <arg> is TRUE (1), piggy backing is enabled.* Piggy backing is disabled for broadcast communication by default.* \i DIST_CTL_OPERATIONAL_HOOK* Set a function to be called, each time a node shifts to operational state.* \i DIST_CTL_CRASHED_HOOK* Set a function to be called, each time a node shifts to crashed state.* \ie** The prototype of the function hooked to the database, should look* like this:* \cs*    void fnc (DIST_NODE_ID nodeStateChanged);* \ce* * RETURNS: OK, the value requested, or ERROR if <function> is unknown.** ERRNO:* S_distLib_UNKNOWN_REQUEST** AVAILABILITY* This routine is distributed as a component of the unbundled distributed* message queues option, VxFusion.* NOMANUAL*/int distNodeCtl    (    int function,        /* function code      */    int arg              /* arbitrary argument */    )    {    int i;    switch (function)        {        case DIST_CTL_MAX_RETRIES:            if (arg < 0)                return (ERROR);            distNodeMaxRetries = arg;            return (OK);        case DIST_CTL_RETRY_TIMEOUT:            if (arg < 0)                return (ERROR);            /*             * <arg> is in ticks;             * <distNodeRetryTimeout> is in manager wakeups;             */            distNodeRetryTimeout = (1000 * arg / sysClkRateGet() +                    DIST_NODE_MGR_WAKEUP_MSEC - 1) / DIST_NODE_MGR_WAKEUP_MSEC;            return (OK);        case DIST_CTL_OPERATIONAL_HOOK:            {            for (i = 0; i < DIST_NODE_MAX_HOOKS; i++)                {                if (distNodeOperationalHook[i] == NULL)                    {                    distNodeOperationalHook[i] = (FUNCPTR) arg;                    return (OK);                    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美图片一区二区三区| 一区二区三区产品免费精品久久75| 日韩国产在线观看| 日韩精品在线网站| 国产一区二区视频在线| 久久婷婷久久一区二区三区| 国产一区二区免费在线| 欧美国产精品一区| 色婷婷久久久久swag精品| 亚洲影视资源网| 91精品国产欧美一区二区18| 韩国v欧美v亚洲v日本v| 中日韩免费视频中文字幕| 99国产一区二区三精品乱码| 亚洲一级不卡视频| 日韩精品一区二区在线| 成人免费视频caoporn| 国产精品国产三级国产aⅴ无密码| 一本色道**综合亚洲精品蜜桃冫| 亚洲国产精品一区二区久久恐怖片| 日韩一区和二区| 成人爱爱电影网址| 五月天网站亚洲| 久久九九久久九九| 欧美午夜精品免费| 国产激情视频一区二区在线观看| 亚洲免费观看高清| 久久夜色精品国产噜噜av| 色婷婷av一区| 国产自产v一区二区三区c| 亚洲精品乱码久久久久久日本蜜臀| 欧美日产国产精品| 成人h精品动漫一区二区三区| 午夜精品久久久久久久久| 国产女人水真多18毛片18精品视频 | 毛片av一区二区三区| 国产精品色婷婷| 欧美一区二区国产| 91久久国产综合久久| 国模套图日韩精品一区二区 | 久久久久久99精品| 欧美日韩精品二区第二页| 丰满放荡岳乱妇91ww| 日韩成人av影视| 一区二区日韩av| 国产精品欧美久久久久无广告 | 国产自产2019最新不卡| 天堂av在线一区| 亚洲男人天堂一区| 日本一区二区动态图| 91精品国产欧美日韩| 日本精品视频一区二区| 成人性生交大片免费看中文网站| 欧美aaaaa成人免费观看视频| 一区二区三区精品视频在线| 中文字幕高清不卡| 久久久久高清精品| 欧美tk—视频vk| 欧美一区二区在线视频| 色香蕉久久蜜桃| av在线一区二区三区| 国产激情视频一区二区在线观看| 免费成人av在线| 日韩va亚洲va欧美va久久| 一区二区成人在线视频| 国产精品美女一区二区三区| 亚洲精品一区二区精华| 欧美一级久久久| 777亚洲妇女| 91精品国产高清一区二区三区| 欧美在线观看一区二区| 色综合天天综合网国产成人综合天| 成人丝袜18视频在线观看| 国产麻豆精品久久一二三| 国内精品在线播放| 国产精品伊人色| 国产成人亚洲综合色影视| 国产精品一区2区| 丁香网亚洲国际| av网站免费线看精品| 91在线国产观看| 色噜噜狠狠色综合中国| 在线免费观看日本一区| 精品视频1区2区3区| 欧美一区二区三区在线视频| 日韩一级视频免费观看在线| 精品国产制服丝袜高跟| 中文字幕二三区不卡| 亚洲婷婷综合色高清在线| 一区二区三区四区在线播放| 亚洲国产视频一区二区| 日韩av一区二区三区| 精品亚洲porn| 成人av在线一区二区三区| 色哦色哦哦色天天综合| 69久久99精品久久久久婷婷| 日韩午夜小视频| 中文字幕精品一区| 一区二区三区成人| 久久精品99久久久| 97精品电影院| 欧美日韩国产成人在线91| 精品奇米国产一区二区三区| 欧美高清一级片在线观看| 一二三区精品福利视频| 裸体在线国模精品偷拍| 白白色 亚洲乱淫| 欧美日韩在线亚洲一区蜜芽| 26uuu精品一区二区在线观看| 18欧美乱大交hd1984| 日韩成人一区二区| jiyouzz国产精品久久| 欧美放荡的少妇| 国产欧美一区二区三区在线看蜜臀| 亚洲精品ww久久久久久p站| 麻豆国产精品视频| 在线亚洲欧美专区二区| 精品国产乱码久久久久久老虎 | 亚洲午夜精品在线| 韩国欧美国产1区| 91国偷自产一区二区三区成为亚洲经典 | 国产精品日日摸夜夜摸av| 亚洲一区二区三区免费视频| 激情综合色综合久久综合| 日本久久电影网| 精品国产免费一区二区三区四区| 亚洲欧美激情一区二区| 久久福利视频一区二区| 日本韩国欧美一区| 欧美高清在线精品一区| 免费一区二区视频| 在线看国产一区| 国产喷白浆一区二区三区| 日韩国产欧美在线观看| 色噜噜狠狠成人网p站| 国产亚洲美州欧州综合国 | 男男成人高潮片免费网站| 972aa.com艺术欧美| 精品国产一区二区三区久久久蜜月| 亚洲精品v日韩精品| 国产.精品.日韩.另类.中文.在线.播放| 欧美日韩一区二区三区四区| 亚洲欧洲一区二区三区| 国产风韵犹存在线视精品| 91精品在线观看入口| 亚洲激情图片小说视频| 成人高清在线视频| 久久久久久日产精品| 麻豆传媒一区二区三区| 在线成人小视频| 午夜影院久久久| 欧亚洲嫩模精品一区三区| 亚洲欧美成人一区二区三区| 东方aⅴ免费观看久久av| 国产亚洲综合色| 国产精品99久久久久久似苏梦涵| 欧美一级一级性生活免费录像| 亚洲成av人片在www色猫咪| 色婷婷亚洲精品| 亚洲综合无码一区二区| 一本大道av伊人久久综合| 亚洲欧洲韩国日本视频| 99热在这里有精品免费| 国产精品国产精品国产专区不片| 国产精品一卡二| 国产精品你懂的| 99re免费视频精品全部| 亚洲日本电影在线| 在线观看日韩毛片| 亚洲国产欧美日韩另类综合 | 欧美伊人久久久久久久久影院| 中文字幕一区二区不卡| 91欧美激情一区二区三区成人| 中文字幕一区二区三区乱码在线| 成人午夜av电影| 日韩久久一区二区| 欧美特级限制片免费在线观看| 亚洲一区欧美一区| 3d成人h动漫网站入口| 麻豆精品久久久| 国产欧美日韩不卡免费| 99九九99九九九视频精品| 亚洲精品久久嫩草网站秘色| 欧美视频自拍偷拍| 蜜桃av一区二区三区电影| 精品日韩欧美一区二区| 东方欧美亚洲色图在线| 一区二区三区中文字幕在线观看| 欧美日韩视频在线第一区| 久久国产生活片100| 国产精品久久久一区麻豆最新章节| 99久久久精品免费观看国产蜜| 亚洲一区二区欧美日韩| 欧美一区二区在线免费播放| 国产一区二区在线观看免费| 亚洲视频中文字幕| 91精品国产免费| 不卡的电影网站| 日韩福利视频网| 国产精品系列在线|