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

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

?? startup.c

?? rip路由在vxworks上的實現(xiàn)源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* startup.c - RIP routines for creating initial data structures *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1983, 1988, 1993 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * @(#)startup.c	8.2 (Berkeley) 4/28/95 *//*modification history--------------------01l,22mar02,niq  Merged from Synth view, tor3_x.synth branch, ver 01q01k,24jan02,niq  SPR 68672 - Add route to the local end of the PTP link with                 the correct netmask                 SPR 72415 - Added support for Route tags01j,15oct01,rae  merge from truestack ver 01m, base 01h (SPR #69983 etc.)01i,10nov00,spm  merged from version 01j of tor3_x branch (SPR #29099 fix)01h,11sep98,spm  provided fatal error handling in place of quit routine,                 replaced ripMakeAddr with optimized results (SPR #22350)01g,01sep98,spm  modified addrouteforif to correctly support interfaces                  with classless netmasks (SPR #22220); changed spacing                 for coding standards01f,26jul98,spm  moved assignment from conditional to avoid compiler warnings01e,06oct97,gnn  fixed SPR 9211 and added sendHook functionality01d,16may97,gnn  added code to initialize hooks to NULL.01c,07apr97,gnn  cleared up some of the more egregious warnings.                 added MIB-II interfaces and options.01b,24feb97,gnn  added rip version 2 functionality.01a,26nov96,gnn  created from BSD4.4 routed*//*DESCRIPTION*//* * Routing Table Management Daemon */#include "vxWorks.h"#include "rip/defs.h"#include "sys/ioctl.h"#include "net/if.h"#include "net/if_dl.h"#include "netinet/in.h"#include "stdlib.h"#include "logLib.h"#include "m2Lib.h"#include "sockLib.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#include "netinet/vsRip.h"#endif /* VIRTUAL_STACK */#define same(a1, a2) \        (memcmp((a1)->sa_data, (a2)->sa_data, 14) == 0)/* globals */#ifndef VIRTUAL_STACKIMPORT int		routedDebug;IMPORT RIP		ripState;struct interface *	ripIfNet;struct interface **	ifnext = &ripIfNet;#endif /* VIRTUAL_STACK *//* locals */#ifndef VIRTUAL_STACKLOCAL int		foundloopback;		/* valid flag for loopaddr */LOCAL struct sockaddr 	loopaddr;		/* our address on loopback */LOCAL struct rt_addrinfo	info;#endif /* VIRTUAL_STACK *//* forward declarations */IMPORT void _ripAddrsXtract (caddr_t, caddr_t, struct rt_addrinfo *); IMPORT int sysctl_rtable (int *, int, caddr_t, size_t *, caddr_t *, size_t);IMPORT void _ripIfShow (struct interface *);void addrouteforif(register struct interface *);LOCAL int add_ptopt_localrt (register struct interface *, int);/* defines *//* Sleazy use of local variables throughout file, warning!!!! */#define NETMASK	info.rti_info[RTAX_NETMASK]#define IFAADDR	info.rti_info[RTAX_IFA]#define BRDADDR	info.rti_info[RTAX_BRD]/******************************************************************************* routedIfInit - initialize interface information** This routine behaves differently based on the <ifindex> parameter.* If <ifIndex> is 0, this routine searches the kernel's "ifnet" interface* list for all interfaces belonging to the AF_INET family and copies the* interface data into RIP private interface table list if that interface is UP.* If <ifIndex> is non-zero then only the specified interface is queried* and its data copied if the interface is UP.** Interfaces that are down are ignored.** For every interface retrieved from the kernel, this routine checks if* a route for the interface address already exists in RIP's table. If it does* this signifies that RIP already knows about this interface address; hence it* skips over that entry. If a route doesn't exist, then RIP adds a route* to that interface in its own table as well as in the system Routing database.* The above procedure is repeated for each address entry present for an* interface.** If an interface has multiple IP addresses (aliases), this routine creates* a different interface entry (virtual interface) for each address. * For example an interface "fei0" in the system with address "100.10.1.1"* and "144.1.1.1" will result in two interfaces in RIP's interface list - * 	1) "fei0", 100.10.1.1*	2) "fei0", 144.1.1.1* The <resetFlag> parameter distinguishes the initial execution of this* routine from later executions which add new interfaces to the list. * It is used to initialize RIP's interface list.** If the sytem runs out of memory during uring the addition of an interface* to RIP's internal list, or if is encounters some incomplete entries, * the "lookforinterfaces" flag is set to automatically repeat the execution* of this routine at the next timer interval. ** The initial execution of this routine (during RIP startup) must succeed* or the session will not begin, but the session will continue regardless* of the results of later executions.** RETURNS: OK, or ERROR if unable to process interface table.** NOMANUAL** INTERNAL* After the RIP session has started, the routine can be called again* within the context of either the RIP timer task or the RIP input task. * The caller should take the ripLockSem semaphore to provide mutual* exclusion so that no message processing happens while the * interface list is changed and any corresponding route entries are* created.*/STATUS routedIfInit    (    BOOL 	resetFlag, 	/* build entire new list or add entries? */    long		ifIndex		/* particular interface to search for, 0-all */    )    {    struct interface ifs, *ifp;    size_t needed;    int mib[6], no_ipaddr = 0, flags = 0;    char *buf, *cplim, *cp;    register struct if_msghdr *ifm;    register struct ifa_msghdr *ifam;    struct sockaddr_dl *sdl = NULL;    struct sockaddr_in *sin;    struct ip_mreq ipMreq; 	/* Structure for joining multicast groups. */    u_long i;    if (resetFlag)        {        /* Reset globals in case of restart after shutdown. */        foundloopback = 0;        ripIfNet = NULL;        ifnext = &ripIfNet;        }    ripState.lookforinterfaces = FALSE;    ipMreq.imr_multiaddr.s_addr = htonl (RIP_MCAST_ADDR);    /*      * The sysctl_rtable routine provides access to internal networking data      * according to the specified operations. The NET_RT_IFLIST operator     * traverses the entire internal "ifnet" linked list created when the     * network devices are initialized. The third argument, when non-zero,     * restricts the search to a particular unit number. In this case, all     * devices are examined. The first argument, when non-zero, limits the     * addresses to the specified address family.      */    mib[0] = AF_INET;    mib[1] = NET_RT_IFLIST;    mib[2] = ifIndex;    /*      * The first call to the routine determines the amount of space needed     * for the results. No data is actually copied.     */    if (sysctl_rtable(mib, 3, NULL, &needed, NULL, 0) < 0)        {        if (routedDebug)            logMsg ("Error %x estimating size of interface buffer.\n", errno,                    0, 0, 0, 0, 0);        return (ERROR);        }    if (routedDebug)        logMsg ("Executing routedInit for iIndex = %d.\n", ifIndex, 0, 0, 0, 0, 0);    /*      * Allocate the required data, and repeat the system call to copy the     * actual values.     */    buf = malloc (needed);    if (buf == NULL)        {        if (routedDebug)            logMsg ("Error %x allocating interface buffer.\n", errno,                    0, 0, 0, 0, 0);        return (ERROR);        }    if (sysctl_rtable(mib, 3, buf, &needed, NULL, 0) < 0)        {        if (routedDebug)            logMsg ("Error %x retrieving interface table.\n", errno,                    0, 0, 0, 0, 0);        free (buf);        return (ERROR);        }    /* End of VxWorks specific stuff. */    /*      * Analyze the retrieved data. The provided buffer now contains a      * structure of type if_msghdr for each interface followed by zero      * or more structures of type ifa_msghdr for each address for that     * interface. The if_msghdr structures have type fields of     * RTM_IFINFO and the address structures have type fields of      * RTM_NEWADDR.     */    cplim = buf + needed;    for (cp = buf; cp < cplim; cp += ifm->ifm_msglen)         {        ifm = (struct if_msghdr *)cp;        if (ifm->ifm_type == RTM_IFINFO)             {            /* Parse the generic interface information. */            memset(&ifs, 0, sizeof(ifs));            ifs.int_flags = flags = (0xffff & ifm->ifm_flags) | IFF_INTERFACE;            /*              * The sockaddr_dl structure containing the link-level address             * immediately follows the if_msghdr structure.             */            sdl = (struct sockaddr_dl *) (ifm + 1);            sdl->sdl_data[sdl->sdl_nlen] = 0;            no_ipaddr = 1;            continue;            }        /*          * Only address entries should be present at this point.         * Exit if an unknown type is detected.         */        if (ifm->ifm_type != RTM_NEWADDR)            {            if (routedDebug)                logMsg ("Unexpected entry in interface table.\n",                         0, 0, 0, 0, 0, 0);            free (buf);            return (ERROR);            }        /* If RIP is not desired on this interface, then so be it */        if (ripIfExcludeListCheck (sdl->sdl_data) == OK)            continue;        /*          * Ignore the address information if the interface initialization         * is incomplete. Set flag to repeat the search at the next timer          * interval.         */        if ( (flags & IFF_UP) == 0)            {            continue;            }        /* Access the address information through the ifa_msghdr structure. */        ifam = (struct ifa_msghdr *)ifm;        /* Reset the pointers to access the address pointers. */        info.rti_addrs = ifam->ifam_addrs;        _ripAddrsXtract ((char *)(ifam + 1), cp + ifam->ifam_msglen, &info);        if (IFAADDR == 0)             {            if (routedDebug)                logMsg ("No address for %s.\n", (int)sdl->sdl_data,                        0, 0, 0, 0, 0);            continue;            }        /* Copy and process the actual address values. */        ifs.int_addr = *IFAADDR;        if (ifs.int_addr.sa_family != AF_INET)            continue;        no_ipaddr = 0;        if (ifs.int_flags & IFF_POINTOPOINT)            {            if (BRDADDR == 0)    /* No remote address specified? */                {                if (routedDebug)                    logMsg ("No dstaddr for %s.\n", (int)sdl->sdl_data,                             0, 0, 0, 0, 0);                continue;                }            if (BRDADDR->sa_family == AF_UNSPEC)                {                ripState.lookforinterfaces = TRUE;                continue;                }            /* Store the remote address for the link in the correct place. */            ifs.int_dstaddr = *BRDADDR;            }        /*         * Skip interfaces we already know about. But if there are         * other interfaces that are on the same network as the ones         * we already know about, we want to know about them as well.         */        if (ifs.int_flags & IFF_POINTOPOINT)            {            if (ripIfWithDstAddrAndIndex (&ifs.int_dstaddr, NULL,                                           ifam->ifam_index))                continue;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久激情五月激情| 国产欧美精品一区二区色综合 | 91国偷自产一区二区三区成为亚洲经典| 久久这里只有精品6| 老司机一区二区| 日韩免费福利电影在线观看| 日韩av中文字幕一区二区| 欧美一卡二卡在线观看| 麻豆成人av在线| 久久色.com| 国产高清不卡一区| 国产精品你懂的在线欣赏| 波多野结衣精品在线| 亚洲天堂精品视频| 欧美日韩视频不卡| 久久精品国产**网站演员| 久久综合久久99| 成人国产精品视频| 亚洲成人自拍偷拍| 精品区一区二区| 成人性生交大片免费看中文网站| 国产精品国产馆在线真实露脸| 91视频一区二区三区| 午夜久久久久久久久久一区二区| 日韩免费一区二区三区在线播放| 国产乱码字幕精品高清av | 欧美日韩中字一区| 精品一区二区在线看| 国产农村妇女精品| 欧美在线你懂的| 精品一区二区三区香蕉蜜桃| 国产精品三级在线观看| 欧美日韩mp4| 国产91丝袜在线播放0| 亚洲精品国产一区二区精华液| 欧美精品一卡二卡| 成人综合婷婷国产精品久久| 亚洲成人综合网站| 欧美—级在线免费片| 欧美日韩五月天| 成人av免费在线观看| 美女视频网站黄色亚洲| 亚洲精选一二三| 久久综合九色综合久久久精品综合| 日本久久电影网| 国产一区二区网址| 亚洲va韩国va欧美va| 欧美国产欧美综合| 日韩视频免费直播| 色久综合一二码| 日韩欧美一区在线观看| 91在线porny国产在线看| 精品在线免费观看| 天天免费综合色| 成人欧美一区二区三区在线播放| 欧美一区二区大片| 色88888久久久久久影院按摩| 韩国理伦片一区二区三区在线播放 | 精品一区二区三区视频在线观看| 一区二区欧美精品| 国产精品国产自产拍高清av| 欧美tk—视频vk| 7777精品久久久大香线蕉| 不卡的av中国片| 国产成人av一区二区三区在线 | 国产寡妇亲子伦一区二区| 视频一区中文字幕国产| 亚洲柠檬福利资源导航| 中文字幕精品一区二区三区精品| 天天色综合成人网| 亚洲精品高清在线观看| |精品福利一区二区三区| 国产日韩欧美不卡在线| 精品sm在线观看| 日韩欧美一区在线观看| 日韩视频123| 欧美一级黄色大片| 欧美一区二区日韩一区二区| 欧美日韩国产免费一区二区| 欧美日韩在线播放三区四区| 色94色欧美sute亚洲线路一久| 91在线小视频| 色屁屁一区二区| 欧美午夜精品一区二区三区| 在线中文字幕不卡| 色欧美日韩亚洲| 欧美性xxxxx极品少妇| 欧美亚州韩日在线看免费版国语版| 一本在线高清不卡dvd| 色偷偷一区二区三区| 国产精品69毛片高清亚洲| 亚洲国产中文字幕在线视频综合| 亚洲综合视频在线| 亚洲午夜av在线| 午夜视频一区二区三区| 日本欧美肥老太交大片| 人人超碰91尤物精品国产| 欧美一区二区三区婷婷月色| 91精品国产乱| 精品剧情在线观看| 国产女人水真多18毛片18精品视频| 国产欧美日韩在线观看| 亚洲欧洲av另类| 伊人夜夜躁av伊人久久| 首页国产欧美久久| 极品尤物av久久免费看| 成人午夜在线免费| 色综合久久综合中文综合网| 欧美日韩国产一级二级| 精品国产乱码久久久久久图片| 国产精品午夜在线观看| 一区二区三国产精华液| 久久99国产精品免费| 成人福利视频在线| 欧美日韩精品一区二区三区四区 | 国产综合一区二区| 北条麻妃国产九九精品视频| 欧美亚洲国产一区二区三区 | 欧美精品 日韩| 久久综合av免费| 亚洲乱码中文字幕| 毛片基地黄久久久久久天堂| 成人av资源在线观看| 欧美日韩国产美| 国产午夜精品一区二区三区嫩草| 国产精品不卡在线| 美女视频免费一区| 一本大道av一区二区在线播放| 91精品麻豆日日躁夜夜躁| 国产精品久久久久久久蜜臀| 日韩中文字幕一区二区三区| 成人丝袜视频网| 91精品蜜臀在线一区尤物| 亚洲欧洲日韩在线| 麻豆91在线播放免费| 欧美在线高清视频| 久久久高清一区二区三区| 亚洲成人1区2区| 波波电影院一区二区三区| 日韩精品专区在线影院观看| 亚洲激情图片小说视频| 国产成a人无v码亚洲福利| 91精品啪在线观看国产60岁| 亚洲欧洲制服丝袜| 国产成a人亚洲精| 日韩免费在线观看| 午夜激情综合网| 色婷婷精品大在线视频| 欧美韩日一区二区三区四区| 免费观看一级特黄欧美大片| 色综合久久88色综合天天| 欧美高清在线一区二区| 精品一区二区国语对白| 欧美一区二区精美| 亚洲二区视频在线| 欧美这里有精品| 亚洲色图一区二区| 成人av网在线| 中文字幕+乱码+中文字幕一区| 精品一区中文字幕| 日韩视频永久免费| 六月丁香综合在线视频| 在线播放中文字幕一区| 亚洲成人av电影在线| 欧美性猛片aaaaaaa做受| 一区二区高清免费观看影视大全| 成人av网站在线| 最新日韩av在线| 99久免费精品视频在线观看| 国产精品美女久久福利网站| 国产超碰在线一区| 国产精品福利av| 97久久超碰精品国产| 国产精品国产三级国产| 91网站最新地址| 亚洲精品成人悠悠色影视| 日本大香伊一区二区三区| 成人国产亚洲欧美成人综合网| 欧美激情在线看| 99久免费精品视频在线观看| 亚洲婷婷在线视频| 欧美午夜电影网| 午夜不卡av在线| 精品少妇一区二区三区免费观看| 黑人巨大精品欧美一区| 久久蜜臀中文字幕| 99在线视频精品| 夜夜嗨av一区二区三区四季av| 欧美在线高清视频| 免费高清成人在线| 国产性天天综合网| 99热精品国产| 偷拍日韩校园综合在线| 日韩欧美一级二级| 国产aⅴ精品一区二区三区色成熟| 中文一区一区三区高中清不卡| 91麻豆免费观看| 日韩精品视频网| 国产亚洲va综合人人澡精品| 一本一道综合狠狠老|