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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? routeutillib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* routeUtilLib.c - miscellaneous utilities for routing interface library *//* Copyright 1984 - 2001 Wind River Systems, Inc. *//*modification history--------------------01e,07aug01,spm  fixed lookup routine to retrieve default route entry01d,03aug01,spm  added flag to prevent incorrect interface reference count01c,02aug01,spm  added virtual stack support01b,02aug01,spm  cleanup: replaced duplicate copy routine with routeDescFill;                 changed routeMetricInfoFromDescCopy to shorter name01a,31jul01,spm  extracted from version 03s of routeEntryLib.c module*//*DESCRIPTIONThis library contains miscellaneous routines which handle duplicate routesto the same destination address. The router stack version of the networkstack uses these routines support the add, delete, and change operations.None of the routines in this library are published or available to customers.INTERNALAll the routines within this library execute while the system holds theinternal table lock, if needed.NOMANUAL*/#ifdef ROUTER_STACK              /* only build for router stack *//* includes */#include "vxWorks.h"#include "memPartLib.h"     /* for KHEAP_FREE definition */#include "routeEnhLib.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"    /* for rt_tables definition */#endif#define SOCKADDR_IN(s) (((struct sockaddr_in*)(s))->sin_addr.s_addr)/* forward declarations */IMPORT STATUS routeCallBackSend (int, void *);IMPORT STATUS routeSocketMessageSend (int, ROUTE_DESC *);void routeDescFill (ROUTE_ENTRY *, ROUTE_DESC *, BOOL);void routeMetricsCopy (ROUTE_DESC *, ROUTE_ENTRY *);ROUTE_ENTRY * routeLookup (struct sockaddr *, ULONG *, int);/********************************************************************************* routeLookup - fetch an entry in the routing table** This routine searches the routing table for an entry which matches the* destination address and the <pNetmask> and <protoId> parameters, if* provided. It returns a pointer to the route for later changes by* public routines. A mask value of zero retrieves a host-specific route,* if any.** NOTE: If the <protoId> value is not zero, this routine searches the*       duplicate routes for a matching entry. That situation requires*       mutual exclusion protection with the internal lock. Otherwise,*       no additional protection is needed.** RETURNS: Pointer to matching route entry, or NULL if none.** NOMANUAL*/ROUTE_ENTRY * routeLookup    (    struct sockaddr * pDest, 	/* IP address reachable with matching route */    ULONG * pMask, 		/* netmask value, in network byte order */    int	protoId 		/* route source from m2Lib.h, or 0 for any. */    )    {    struct radix_node_head * pHead = rt_tables[pDest->sa_family];    struct radix_node * pNode;        /* radix tree entry for route */    struct rtentry * pRoute = NULL;   /* candidate for matching route */    ROUTE_ENTRY * pMatch = NULL;      /* matching route entry */    struct sockaddr_in netmask;       /* netmask value, internal format */    char * pNetmask = NULL;           /* target netmask value from tree */    struct rtentry * pNextRoute;    STATUS result = ERROR;            /* OK indicates a successful search */    int  s;    if (pHead == NULL)        {        /* No route table exists for the given address family. */        return (NULL);        }    bzero ( (char *)&netmask, sizeof (struct sockaddr_in));    s = splnet ();    /*     * If a specific netmask match is required, find the target value     * (a pointer to the stored netmask entry) which will determine     * whether the match exists. A mask value of zero indicates a     * host-specific route, which does not contain a netmask entry.     */    if (pMask && *pMask)        {        /* Setup data structure to search mask's tree for given value. */        netmask.sin_family = AF_INET;        netmask.sin_len = sizeof (struct sockaddr_in);        netmask.sin_addr.s_addr = *pMask;        TOS_SET (&netmask, 0x1f);        in_socktrim (&netmask);    /* Adjust length field for tree search. */        /* Search for netmask from corresponding tree. */        pNode = rn_addmask (&netmask, 1, pHead->rnh_treetop->rn_off);        if (pNode == 0)            {            /* No route currently uses the specified netmask. */#ifdef DEBUG            logMsg ("routeLookup: requested mask does not exist.\n",                    0, 0, 0, 0, 0, 0);#endif            splx(s);            return (NULL);            }        pNetmask = pNode->rn_key;        }    pNode = pHead->rnh_matchaddr ((caddr_t)pDest, pHead);    if (pNode && ((pNode->rn_flags & RNF_ROOT) == 0))        {        /* Possible match found. Save for later use. */        pRoute = (struct rtentry *)pNode;        }    else        {        /* No route matches the given key. */        splx (s);        return (NULL);        }#ifdef DEBUG    logMsg ("routeLookup: candidate for match at %p.\n", pNode,            0, 0, 0, 0, 0);#endif    /*     * Compare the set of routes available with the initial key     * against the desired values. Each entry in the chain of     * routes with duplicate keys uses a different netmask value.     *     * NOTE: The pNode value is not necessarily the start of the     * chain. It is the first entry in the chain with a short     * enough netmask to produce a match against the destination.     */    for ( ; pRoute != NULL; pRoute = pNextRoute)        {        /* Select the next route candidate in case a test fails. */        pNextRoute = (struct rtentry *)                           ((struct radix_node *)pRoute)->rn_dupedkey;        if (pMask)            {            /*             * Check mask of route against corresponding entry from             * the stored netmasks (derived from the given value).             */#ifdef DEBUG            logMsg ("routeLookup: checking against specific mask.\n",                    0, 0, 0, 0, 0, 0);#endif            if (*pMask)                {                if ( ((struct radix_node *)pRoute)->rn_mask != pNetmask)                    continue;   /* Mask values do not match. */                }            else if ( ( (struct sockaddr_in *)pDest)->sin_addr.s_addr)                {                /* Searching for a host-specific route (no netmask entry). */                if ( ((struct radix_node *)pRoute)->rn_mask != 0)                    continue;   /* Entry is not a host route. */                }            }        /*         * Candidate passed any mask requirements. Search for entries         * which match the specified route source.         */#ifdef DEBUG        logMsg ("routeLookup: Current mask is OK.\n", 0, 0, 0, 0, 0, 0);#endif        if (protoId)            {            /* Check source of route against specified value. */#ifdef DEBUG            logMsg ("routeLookup: testing protocol ID.\n",                    0, 0, 0, 0, 0, 0);#endif            for (pMatch = (ROUTE_ENTRY *)pRoute; pMatch != NULL;                   pMatch = pMatch->diffNode.pFrwd)                {                if (RT_PROTO_GET(ROUTE_ENTRY_KEY(pMatch)) == protoId)                    break;                }            if (pMatch == NULL)   /* Route protocol values do not match. */                continue;#ifdef DEBUG            logMsg ("routeLookup: Current protocol ID is OK.\n",                    0, 0, 0, 0, 0, 0);#endif            }        else            {            /*             * No route source is specified. Accept the entry             * which met any mask criteria.             */            pMatch = (ROUTE_ENTRY *)pRoute;            }         /* The candidate route entry met all criteria. Stop the search. */        result = OK;        break;        }    if (result == OK)        {        /* Increase the reference count before returning the matching entry. */        pMatch->rtEntry.rt_refcnt++;        }    else        pMatch = NULL;    splx (s);    return (pMatch);    }/********************************************************************************* routeEntryFind - find a route entry and the appropriate location** This routine searches the extended lists attached to the <pRoute>* entry which is visible to the IP forwarding process. It retrieves* any route entry which matches the supplied protocol identifier and* gateway. If the protocol is not specified, the routine selects an* entry in the first protocol group. If the gateway is not specified,* it retrieves the initial route entry in the selected group.** Both the change and delete operations require a matching route. The add* operation fails in this situation, since the gateway and protocol * identifier must be unique for a particular destination address and netmask.** This routine also provides the adjacent entries for a route based on* the specified weight value, if pointers to retrieve those entries are* available. The first entry in a group uses a lower weight than all* subsequent entries from the same protocol. It is connected to the initial* entries from other groups and t * next entry with the same protocol type.* Subsequent entries in a group are only connected to successors and* predecessors within that group.** The add and change operations use this neighboring route information* to store a new or altered entry at the correct location. The delete* operation uses a <weight> value of 0 to skip the search for neighboring* routes since it does not provide pointers to retrieve those values.** NOTE: This routine requires the mutual exclusion protection for*       the routing table to prevent moving or replacing the matching*       route's adjacent entries.** RETURNS: Pointer to existing route, or NULL if none.** NOMANUAL*/ROUTE_ENTRY * routeEntryFind    (    ROUTE_ENTRY * pRoute, 	/* primary route for destination/netmask */    short protoId, 		/* protocol identifer for route */    struct sockaddr * pGateway,	/* next hop gateway for route */    ROUTE_ENTRY ** ppGroup, 	/* initial entry (head) of existing group */    ROUTE_ENTRY ** ppLastGroup,	/* predecessor if head of group changes */    ROUTE_ENTRY ** ppNextGroup, /* successor if head of group changes */    ROUTE_ENTRY ** ppLast, 	/* previous entry in matching group */    ROUTE_ENTRY ** ppNext, 	/* next entry in matching group */    UCHAR weight 		/* weight value for route, 0 for delete */    )    {    ROUTE_ENTRY * pGroup;    /* initial route entry with matching protocol */    ROUTE_ENTRY * pMatch = NULL;  /* duplicate route entry, if any. */    ROUTE_ENTRY * pNextGroup = NULL;  /* Group with higher minimum weight. */    ROUTE_ENTRY * pLastGroup = NULL;  /* Previous group entry in list. */    ROUTE_ENTRY * pBack = NULL;   /* Preceding route entry in group. */    ROUTE_ENTRY * pNext = NULL;   /* Next route entry in group. */    ROUTE_ENTRY * pTemp;          /* Loop index. */    BOOL gatewayFlag;    /* Gateway value specified? */    UCHAR nextWeight;    /* Weight for initial group entry after increase. */    if (pGateway == NULL || SOCKADDR_IN (pGateway) == 0)        gatewayFlag = FALSE;    else        gatewayFlag = TRUE;     /*     * Find the group which matches the protocol for the targeted route,     * if any. Use the first group if no value is specified. This search     * also finds an adjacent group if no match occurs or if the protocol     * does not match the first group and the provided weight value is less     * than the initial entry in the matching group.     */    for (pGroup = pRoute; pGroup != NULL; pGroup = pGroup->diffNode.pFrwd)        {        if (protoId == 0)    /* No protocol specified - use initial group. */            break;        if (RT_PROTO_GET(ROUTE_ENTRY_KEY(pGroup)) == protoId)            break;        /*         * If the weight value for the targeted route is less than         * the current minimum in an earlier group (which therefore         * uses a lower weight than the matching group), save the         * new successor for the matching group. Ignore this test         * for the delete operation, which selects a new adjacent         * group separately, if needed.         */        if (weight && pNextGroup == NULL &&                weight < pGroup->rtEntry.rt_rmx.weight)            {            pNextGroup = pGroup;#ifdef DEBUG            logMsg ("routeEntryFind: inserting ahead of group at %x.\n",                    pNextGroup, 0, 0, 0, 0, 0);#endif            }        /*         * Save the current group entry, which will eventually equal the         * tail of the list if no matching group exists. That final entry         * is required when creating a new group with a larger minimum         * weight than all existing groups.         */        pLastGroup = pGroup;        }    /*     * Assign the preceding group if the weight value inserts a new group     * into the list or promotes an existing group to an earlier position.     */    if (pNextGroup)        {        pLastGroup = pNextGroup->diffNode.pBack;        }    /*     * Find the specific route entry which matches the supplied gateway     * address within the selected group. Use the initial entry if no     * value is specified. The delete and change operations require a     * match, but the add operation fails in that case.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜一区二区三区| 久久女同互慰一区二区三区| 精品乱人伦小说| 一区二区三区国产精品| 丰满亚洲少妇av| 欧美激情资源网| 亚洲日本在线视频观看| 国产成人午夜高潮毛片| 在线观看一区二区精品视频| 91精品在线观看入口| 欧美做爰猛烈大尺度电影无法无天| 欧美绝品在线观看成人午夜影视| 亚洲国产激情av| caoporen国产精品视频| 成人黄色小视频在线观看| 久久婷婷国产综合国色天香| 国产福利91精品一区| 全国精品久久少妇| 亚洲欧美日韩一区二区| 国产日本亚洲高清| 欧美大片日本大片免费观看| 欧美日韩免费一区二区三区视频| 99久久国产综合精品女不卡| 国产精品资源在线观看| 精品一区二区三区影院在线午夜| 亚洲成人高清在线| 亚洲一区在线电影| 亚洲色图视频网站| 国产精品美女久久久久久| 久久久精品一品道一区| 日韩一区二区三区高清免费看看| 欧美日韩在线不卡| 欧美色区777第一页| 一本大道久久精品懂色aⅴ| 成人精品电影在线观看| 国产精品一区在线| 国产精品一区一区三区| 国产一区二区在线影院| 国产综合久久久久久鬼色 | 久久国产精品色| 日韩av电影免费观看高清完整版| 亚洲3atv精品一区二区三区| 亚洲午夜羞羞片| 亚洲高清免费观看高清完整版在线观看| 亚洲蜜臀av乱码久久精品| 亚洲免费av网站| 亚洲第一av色| 日韩成人免费在线| 麻豆精品国产91久久久久久| 美女网站在线免费欧美精品| 久久国产精品72免费观看| 精品一区二区三区在线观看 | 精品一区二区三区免费观看| 奇米影视在线99精品| 美女视频免费一区| 国产伦精品一区二区三区免费| 国产精品91一区二区| 波波电影院一区二区三区| 91一区在线观看| 欧洲生活片亚洲生活在线观看| 欧美精品三级在线观看| 日韩亚洲欧美成人一区| 久久久美女毛片| 一区在线中文字幕| 亚洲一区二区在线视频| 日韩二区在线观看| 国产精品一区免费视频| 国产欧美日韩综合精品一区二区| 国产无遮挡一区二区三区毛片日本| 国产日韩精品一区| 亚洲人被黑人高潮完整版| 亚洲va在线va天堂| 精品亚洲成a人在线观看| 成人v精品蜜桃久久一区| 色综合天天综合网国产成人综合天 | 久久综合九色欧美综合狠狠| 国产人妖乱国产精品人妖| 亚洲色图制服丝袜| 日韩中文字幕麻豆| 国产福利一区在线| 在线观看日韩高清av| 欧美videossexotv100| 国产精品久久久久久妇女6080| 亚洲mv大片欧洲mv大片精品| 久久99国产精品久久99| av一区二区三区在线| 欧美顶级少妇做爰| 中文字幕第一页久久| 日韩成人午夜电影| 91在线码无精品| 精品免费日韩av| 亚洲精品久久久蜜桃| 加勒比av一区二区| 欧美影视一区二区三区| 久久久久久一级片| 婷婷成人激情在线网| 成人午夜激情片| 欧美一区二区网站| 一区二区视频在线| 国产一区二区三区在线观看免费| 欧美在线短视频| 中文字幕av不卡| 精品午夜久久福利影院| 欧美午夜精品一区二区蜜桃| 中文字幕国产一区| 国产在线视频一区二区三区| 欧美日韩一区高清| 亚洲人成人一区二区在线观看| 国产精品亚洲综合一区在线观看| 51精品视频一区二区三区| 中文字幕日韩一区二区| 国产成人啪免费观看软件 | 4438x亚洲最大成人网| 亚洲欧洲制服丝袜| 粉嫩av亚洲一区二区图片| 91精品国产高清一区二区三区| 一二三四区精品视频| 成人免费观看视频| 国产日韩欧美精品在线| 国产一区欧美一区| 亚洲精品在线观看视频| 免费高清在线一区| 制服丝袜中文字幕亚洲| 首页国产欧美日韩丝袜| 欧美性受xxxx| 成人免费看片app下载| 欧美激情中文字幕| 国产成人一区在线| 久久久欧美精品sm网站| 国产精品综合二区| 国产亚洲va综合人人澡精品 | 欧美在线一区二区| 亚洲裸体在线观看| 色综合久久久久| 亚洲欧美福利一区二区| 99久久久久久| 国产精品久久久久7777按摩| 风间由美中文字幕在线看视频国产欧美| 久久久久国产成人精品亚洲午夜| 极品少妇xxxx偷拍精品少妇| 国产成人精品综合在线观看 | 成人黄色av网站在线| 亚洲女人****多毛耸耸8| 精品国精品自拍自在线| 国产成+人+日韩+欧美+亚洲| 一区二区三区四区乱视频| 欧美一区二区三区公司| 国产成人综合在线播放| 亚洲成av人影院| 国产精品日产欧美久久久久| 欧美日韩国产美女| 99精品视频在线免费观看| 天天色综合天天| 亚洲人成小说网站色在线| 久久婷婷一区二区三区| 欧美精品vⅰdeose4hd| 91视频在线看| 91年精品国产| 高清成人免费视频| 国产精品自产自拍| 99re8在线精品视频免费播放| 成人综合婷婷国产精品久久蜜臀| 五月激情综合网| 亚洲国产激情av| 欧美日韩在线三区| 欧美日韩国产天堂| 91官网在线观看| 成熟亚洲日本毛茸茸凸凹| 欧洲视频一区二区| 亚洲亚洲人成综合网络| 麻豆一区二区三区| 成人午夜在线视频| 亚洲综合男人的天堂| 欧美精品高清视频| 国产精品一品二品| 亚洲一二三区在线观看| 精品国产人成亚洲区| 99精品在线免费| 日本午夜一区二区| 国产精品免费免费| 91麻豆精品国产91久久久| 国产高清在线观看免费不卡| 亚洲欧美韩国综合色| 精品国产免费视频| 日本高清不卡一区| 激情欧美一区二区三区在线观看| 亚洲摸摸操操av| 久久综合九色综合欧美亚洲| 91农村精品一区二区在线| 久久国产视频网| 亚洲一区在线看| 国产精品素人视频| 91精品国产高清一区二区三区蜜臀| 成人国产精品免费网站| 日产国产欧美视频一区精品| 日韩一区在线看| 久久综合色一综合色88| 欧美蜜桃一区二区三区| 972aa.com艺术欧美| 韩日av一区二区|