亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩视频第一区| 日韩一区二区三区免费观看| 欧美日韩一区不卡| 国产亚洲精品精华液| 亚洲h动漫在线| 成人国产精品视频| 精品国产自在久精品国产| 亚洲在线视频免费观看| 成人免费观看av| 欧美老年两性高潮| 亚洲欧美日韩中文播放| 国产成人综合亚洲网站| 欧美一级夜夜爽| 亚洲图片有声小说| 欧洲一区在线电影| 中文字幕在线不卡一区二区三区| 精品一区二区三区的国产在线播放| 欧美色网站导航| 亚洲免费在线看| 成人app软件下载大全免费| 久久久亚洲精华液精华液精华液| 日日摸夜夜添夜夜添亚洲女人| 91久久精品一区二区| 亚洲视频一区在线| 成人动漫在线一区| 亚洲国产经典视频| 成人丝袜视频网| 国产精品女同互慰在线看| 欧美特级限制片免费在线观看| 欧美日韩夫妻久久| 国产午夜精品久久久久久免费视 | 激情深爱一区二区| www.在线成人| 91精品国产麻豆国产自产在线| 日韩免费看的电影| 亚洲美女精品一区| 亚洲免费观看视频| 91啪九色porn原创视频在线观看| 中文字幕一区二| 色综合一个色综合| 亚洲成人av在线电影| 欧美二区乱c少妇| 麻豆精品蜜桃视频网站| 精品91自产拍在线观看一区| 国产一区视频在线看| 中文字幕免费不卡| 91首页免费视频| 香蕉久久夜色精品国产使用方法| 91精选在线观看| 国产一区不卡在线| 国产精品久久一卡二卡| 色吧成人激情小说| 三级亚洲高清视频| 久久久久国产精品免费免费搜索| 9久草视频在线视频精品| 亚洲国产日韩a在线播放性色| 欧美高清视频在线高清观看mv色露露十八 | 亚洲欧洲性图库| 欧美日韩激情一区二区| 极品美女销魂一区二区三区 | 成人精品gif动图一区| 伊人夜夜躁av伊人久久| 欧美一级日韩不卡播放免费| 国内精品视频一区二区三区八戒 | 久久久国产精品午夜一区ai换脸| 99免费精品在线观看| 日日夜夜免费精品| 国产精品高潮久久久久无| 欧美日韩免费高清一区色橹橹| 在线一区二区视频| 偷拍一区二区三区四区| 久久亚洲一区二区三区四区| www.激情成人| 日产国产高清一区二区三区| 国产日韩欧美制服另类| 在线精品视频一区二区三四| 日韩二区在线观看| 综合分类小说区另类春色亚洲小说欧美| 91丨九色丨蝌蚪丨老版| 九九精品一区二区| 亚洲一区二区精品视频| 久久久一区二区三区捆绑**| 欧美色图激情小说| 成人激情免费视频| 韩国毛片一区二区三区| 丝瓜av网站精品一区二区| 国产精品久久久久aaaa| 色综合久久久久久久久久久| 亚洲日本一区二区| 欧美日韩日日摸| 久久国产精品99精品国产| 久久亚洲捆绑美女| 99久久精品国产一区| 一区二区三区日韩精品| 欧美精品1区2区3区| 韩国av一区二区| 国产日产精品一区| 欧美性生活影院| 精品中文字幕一区二区| 国产精品美女久久久久aⅴ国产馆| 中文字幕在线不卡一区| 欧美电影免费观看高清完整版在| 91国产视频在线观看| 99国产欧美另类久久久精品 | 日韩精品1区2区3区| 日韩美女视频一区二区| 日本一区二区三区免费乱视频| 欧美精品一区二区蜜臀亚洲| 91精品国产欧美一区二区| 欧美日韩国产bt| 欧美日韩的一区二区| 欧美色图片你懂的| 欧美精品色一区二区三区| 欧美视频你懂的| 欧美丰满少妇xxxxx高潮对白| 欧美日韩午夜影院| 7777精品伊人久久久大香线蕉| 欧美色中文字幕| 欧美一级免费观看| 精品久久久久久无| 欧美精品一区二区在线播放| 久久综合999| 国产精品丝袜一区| 亚洲精品国产视频| 亚洲成人福利片| 久久精品99久久久| 国产精品一区二区男女羞羞无遮挡| 久久国产精品色| 欧美变态tickle挠乳网站| 色综合中文字幕| 成人av综合在线| 国产乱人伦精品一区二区在线观看| 日韩高清国产一区在线| 亚洲人成7777| 中文字幕一区三区| 国产精品久久久久久久蜜臀| 精品国产成人在线影院| 在线播放一区二区三区| 91国内精品野花午夜精品| 91色.com| 一道本成人在线| 99精品视频一区| 成人18精品视频| 国产成人精品亚洲777人妖| 激情五月激情综合网| 蜜桃一区二区三区在线观看| 亚洲一区成人在线| 一区二区三区四区视频精品免费| 一区在线播放视频| 亚洲欧美色综合| 亚洲精品成a人| 一区二区三区国产精品| 亚洲欧美日韩一区二区| 亚洲麻豆国产自偷在线| 亚洲欧美日韩国产另类专区| 1024成人网| 亚洲精品国产第一综合99久久 | 欧美视频一区二区三区在线观看| 91久久精品一区二区三| 欧美午夜电影一区| 欧美狂野另类xxxxoooo| 日韩美一区二区三区| 久久综合成人精品亚洲另类欧美 | 亚洲视频你懂的| 亚洲综合免费观看高清完整版在线 | 欧美国产日韩亚洲一区| 国产精品国产自产拍高清av| 国产精品成人午夜| 亚洲国产视频在线| 久久精品国产**网站演员| 国产成人精品一区二| 色综合网色综合| 欧美日韩一本到| 精品久久一二三区| 国产精品人人做人人爽人人添| 亚洲欧洲国产日韩| 亚洲1区2区3区4区| 久久国产生活片100| 成人影视亚洲图片在线| 在线观看成人小视频| 日韩欧美国产综合| 国产精品第四页| 日韩精品午夜视频| 成人免费视频国产在线观看| 欧美主播一区二区三区美女| 日韩一区二区三区四区| 亚洲色大成网站www久久九九| 丝袜亚洲另类欧美| 成人国产精品免费网站| 91精品国产色综合久久不卡电影| 久久久亚洲精品一区二区三区| 亚洲激情在线播放| 激情亚洲综合在线| 欧美在线不卡视频| 久久久久久一二三区| 天天av天天翘天天综合网| 国产suv一区二区三区88区| 宅男噜噜噜66一区二区66| 一区精品在线播放| 国产一区欧美二区|