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

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

?? ospf_netinet_interface.c

?? vxworks下ospf協(xié)議棧
?? C
字號:
/* ospf_netinet_interface.c - OSPF Source File for Interface with the Kernel * Layer Components *//* Copyright 2001-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02b,12may03,asr  Changes to make OSPF virtual stack compatible02a,30aug02,agi  Fixed DIAB compiler warnings01b,12Oct01,aj   Incorporated changes for Synth compatibility.01a,27Jun01,mist written.*//*DESCRIPTIONThis Source Files contains the Wrapper functions written for the lowerlayer functions.When OSPF Initializes, it calls several lower layer functions such as theINADDR_TO_IFP, IFP_TO_IA,in_addmulti etc which are not visible to protectiondomains.Hence in order to make OSPF  work on application domains,each of theabove functions need to be placed inside a Wrapper Function which is exportedso that protection domains can call these functions.*//* includes */#if defined (__OSPF_ROUTER_STACK__) /*only include this file for router stack*/#include <stdio.h>#include <vxWorks.h>#include <netLib.h>#include <net/protosw.h>#include <net/domain.h>#include <net/mbuf.h>#include <netinet/in.h>#include <netinet/in_systm.h>#include <netinet/in_pcb.h>#include <netinet/ip.h>#include <netinet/ip_var.h>#include <sys/socket.h>#include <net/socketvar.h>#include <errno.h>#include <sys/stat.h>#include <net/if.h>#include <net/route.h>#include <netinet/in_var.h>#include <netinet/in_systm.h>#include "ospf_kernel_interface.h"#if defined (VIRTUAL_STACK)    #include <netinet/vsIp.h>    #include <netinet/vsLib.h>    #include <netinet/vsNetCore.h>#endif /* VIRTUAL_STACK */#define IP_PROT_OSPF    89/* globals */IMPORT OSPF_CALLBACK_IF OspfRegistrationInfo;/* declarations *//* externs */#if !defined (VIRTUAL_STACK)    IMPORT int    _protoSwIndex;    IMPORT struct protosw   inetsw [IP_PROTO_NUM_MAX];    IMPORT u_char ip_protox [IPPROTO_MAX];#endif /* VIRTUAL_STACK *//******************************************************************************** ospfProtocolRegistration ()** Wrapper Function for the* OSPF protosw Entry Initialization** RETURNS : 1 if Initialization was successfull*          -1 if Initialization was not successfull*/int ospf_protocol_registration    (    struct protosw ospf_protocol_switch#if defined (VIRTUAL_STACK)    ,    int vsNumber#endif /* VIRTUAL_STACK */    )    {    FAST struct protosw *   p_ospf_protocol_switch;#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (vsNumber);#endif /* VIRTUAL_STACK */    p_ospf_protocol_switch = &ospf_protocol_switch;    if (_protoSwIndex >= ((sizeof (inetsw)) / (sizeof (inetsw[0]))))        {        printf ("OSPF: _protoSwIndex not correct ... Returning error\r\n");        return (-1) ;        }    p_ospf_protocol_switch = &inetsw [_protoSwIndex];    if (p_ospf_protocol_switch->pr_domain != NULL)        {        return (1);                 /* already initialized */        }    p_ospf_protocol_switch->pr_type       = SOCK_RAW;    p_ospf_protocol_switch->pr_domain     = &inetdomain;    p_ospf_protocol_switch->pr_protocol  = IPPROTO_OSPF;    p_ospf_protocol_switch->pr_flags      = PR_ATOMIC|PR_ADDR;    /* use rip_input to receive packets from IP layer */    p_ospf_protocol_switch->pr_input    = rip_input;    /* pr_output and pr_ctlinput in protosw[] are not used by raw socket */    p_ospf_protocol_switch->pr_output   = 0;    p_ospf_protocol_switch->pr_ctlinput = 0;     p_ospf_protocol_switch->pr_ctloutput = rip_ctloutput;     p_ospf_protocol_switch->pr_usrreq    = rip_usrreq;     p_ospf_protocol_switch->pr_init      =  0 ;     p_ospf_protocol_switch->pr_fasttimo  =  0;     p_ospf_protocol_switch->pr_slowtimo  =  0;     p_ospf_protocol_switch->pr_drain     =  0;     p_ospf_protocol_switch->pr_sysctl    =  0;     ip_protox[IPPROTO_OSPF] = _protoSwIndex;     _protoSwIndex++;     return 1;    }/* * inaddress_to_ifp () * Wrapper Function written for the macro INADDR_TO_IFP * which is defined in netinet/in_var.h * * The INADDR_TO_IFP accesses the global in_ifaddr pointer which cannot be * accessed from the application domain context. * * RETURNS : ifnet* pointer if the address was found *         :  NULL   if the address was not found * */struct ifnet*    inaddress_to_ifp    (    struct in_addr addr    )    {    register struct in_ifaddr *ia;    struct ifnet*  ifp;    int s;    /* asr: need to acquire n/w semaphore before using in_ifaddr */#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (ospf.ospf_vsid);    s = splnet();for    (        ia = _in_ifaddr;    ia != NULL && (IA_SIN(ia)->sin_addr.s_addr != (addr).s_addr);    ia = ia->ia_next    )#else    s = splnet();for    (    ia = in_ifaddr;    ia != NULL && (IA_SIN(ia)->sin_addr.s_addr != (addr).s_addr);    ia = ia->ia_next    )#endif /* VIRTUAL_STACK */    continue;    ifp = (ia == NULL) ? NULL : ia->ia_ifp;    splx(s);    return ifp;    }/* * ospf_kernel_register_with_ip() - Wrapper Function for * ospf_register_with_ip () * * RETURNS: N/A */voidospf_kernel_register_with_ip    (    FP_OSPF_RECEIVE pospfReceive,    FP_OSPF_SEND pospfSend    )    {    OspfRegistrationInfo.pOSpfReceive = pospfReceive;    OspfRegistrationInfo.pOSpfSend    = pospfSend;    OspfRegistrationInfo.ospfEnabled  = 1;    return;    }/* * ospf_kernel_deregister_with_ip () - Wrapper Function for * ospf_deregister_with_ip () * */voidospf_kernel_deregister_with_ip    (    FP_OSPF_RECEIVE pospfReceive,    FP_OSPF_SEND pospfSend    )    {    OspfRegistrationInfo.pOSpfReceive = pospfReceive;    OspfRegistrationInfo.pOSpfSend = pospfSend;    OspfRegistrationInfo.ospfEnabled = 0;    return;    }/* * interface_address_to_ia () - Wrapper Function for the macro IFP_TO_IA declared in * netinet/in_var.h * * * * RETURNS : in_ifaddr* Pointer if the ifnet entry is found. *      NULL       if the ifnet Entry is not found * */struct in_ifaddr*    interface_address_to_ia    (    struct ifnet* ifp    )    {    struct in_ifaddr *ia;    int s;    /* asr: need to acquire n/w semaphore before using in_ifaddr */    #if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet(ospf.ospf_vsid);    s = splnet();    for    (    ia = _in_ifaddr;    ia != NULL && (ia)->ia_ifp != (ifp);    (ia) = (ia)->ia_next    )  #else  s = splnet();  for    (    ia = in_ifaddr;    ia != NULL && (ia)->ia_ifp != (ifp);    (ia) = (ia)->ia_next    ) #endif /* VIRTUAL_STACK */    {        continue;    }    splx(s);    return ia;    }/******************************************************************************** ospf_check_interface ()**  Wrapper Function to check for the Interface Up Flag in the* ifnet Structure** RETURNS : 1 if the ifnet Entry containing the given IP Address is found*           0 if the ifnet Entry not found for the given IP Address*/int    ospf_check_interface    (    unsigned long ip_address    )    {    struct ifnet *sptr_ifnet;    struct ifaddr* sptr_ifaddr;    struct in_ifaddr * sptr_interface_address;    int s;    sptr_ifnet = NULL;    sptr_ifaddr = NULL;#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (ospf.ospf_vsid);#endif /* VIRTUAL_STACK */    s = splimp ();#if !defined (VIRTUAL_STACK)    for (sptr_ifnet = ifnet; sptr_ifnet; sptr_ifnet = sptr_ifnet->if_next)#else    for (sptr_ifnet = _ifnet; sptr_ifnet; sptr_ifnet = sptr_ifnet->if_next)#endif        {        for        (        sptr_ifaddr = sptr_ifnet->if_addrlist;        sptr_ifaddr;        sptr_ifaddr = sptr_ifaddr->ifa_next        )            {            IFP_TO_IA (sptr_ifnet, sptr_interface_address);            if (sptr_interface_address == NULL)                {                continue;                }            /* check the sin family type for Internet */            if (sptr_interface_address->ia_addr.sin_family != AF_INET)                {                continue;                }            if (sptr_interface_address->ia_addr.sin_addr.s_addr == ip_address)                {                if (sptr_ifnet->if_flags &IFF_UP)                    {                    splx (s);                    return 1;                    }                else                 printf("OSPF: INTERFACE DOWN with address (HEX) %lx\r\n", ip_address);                }            } /* for */        }     /* for */    splx (s);    return 0;    }/******************************************************************************** join_multicast_group ()** Wrapper Function written for the in_addmulti function* which cannot be accessed in the  Application Domain.** RETURNS : mBlk* Pointer if in_addmulti was successfull* NULL  if in_addmulti fails*/struct mBlk* join_multicast_group    (    struct in_addr* multicast_address,    unsigned long ospf_ip_address,    struct inpcb* inpcbptr    )    {    struct mBlk* mBlkptr = NULL;    struct in_addr ip_address;    struct ifnet* vx_ospf_interface;    int s;    ip_address.s_addr = ospf_ip_address;#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (ospf.ospf_vsid);#endif /* VIRTUAL_STACK */    /* asr: need to acquire semaphore */    s = splnet();    INADDR_TO_IFP (ip_address, vx_ospf_interface);    splx(s);    if(NULL == (mBlkptr = in_addmulti (multicast_address, vx_ospf_interface, inpcbptr)))        {#if defined(__MISTRAL_DEBUG__)         printf("OSPF: in_addmulti failed for address (HEX) %lx\r\n",             multicast_address->s_addr);#endif /* (__MISTRAL_DEBUG__) */         return NULL;        }    else        {         return mBlkptr;        }    }/******************************************************************************** ospf_check_multicast_if_bit ()** Wrapper function to est the IFF_MULTICAST_IF flag in the ifnet structure** RETURNS : 1 if the IFF_MULTICAST_IF bit is set for the ifnet entry for the* given IP Address 0 if the IFF_MULTICAST_IF bit is reset for the ifnet entry* for the given Address*/int ospf_check_multicast_if_bit    (    unsigned long ip_address    )    {    struct ifnet* pifnet;    struct in_addr addr;    addr.s_addr = ip_address;    pifnet = inaddress_to_ifp (addr);    if (pifnet && (pifnet->if_flags & IFF_MULTICAST))        return 1;    else        return 0;    }/******************************************************************************** ospf_check_interface_address_for_receive ()** Wrapper function to Check for the* interface address while receving IP packets from the raw socket*** RETURNS : 1 if the Received Interface Address Matches the OSPF Port Address* 0 if the Received Interface Address does not match the OSPF Port Address**/int ospf_check_interface_address_for_receive    (    unsigned long ip_address,    struct ifnet* pifnet    )    {    struct in_ifaddr* interface_address;    int s;#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (ospf.ospf_vsid);#endif /* VIRTUAL_STACK */    /* asr: need to acquire semaphore */    s = splnet();    IFP_TO_IA (pifnet, interface_address);    splx(s);    if (ip_address  == interface_address->ia_addr.sin_addr.s_addr)        return 1;    else        return 0;    }/******************************************************************************** ospf_check_interface_index ()** Wrapper function to check the ifnet index member for the* receiving interface.** RETURNS : 1 if the Received Interface Index matches with the given ifnet** Pointer's Index 0 if the Received Interface Index matches with the given* ifnet* Pointer's Index*/int ospf_check_interface_index    (    struct ifnet* p_ospf_ifnet,    struct ifnet* p_receive_ifnet    )    {    if (p_ospf_ifnet->if_index == p_receive_ifnet->if_index)        return 1;    else        return 0;    }/******************************************************************************** ospf_if_status()- Wrapper Function to check for the Interface UP or DOWN* Flag in the ifnet structure.** RETURNS : 2 if the ifnet Entry Flag is UP.*           1 if the ifnet Entry Flag is DOWN.*           0 if the ifnet Entry does not contain ip_address*/int    ospf_if_status    (    unsigned long   intf,    int         interface_index,    unsigned long   ip_address    )    {    struct ifnet *sptr_ifnet;    struct ifaddr* sptr_ifaddr;    struct in_ifaddr * sptr_interface_address;    int s;    sptr_ifnet = NULL;    sptr_ifaddr = NULL;#if defined (VIRTUAL_STACK)    virtualStackNumTaskIdSet (ospf.ospf_vsid);#endif /* VIRTUAL_STACK */    s = splimp ();#if !defined (VIRTUAL_STACK)    for (sptr_ifnet = ifnet; sptr_ifnet; sptr_ifnet = sptr_ifnet->if_next)#else    for (sptr_ifnet = _ifnet; sptr_ifnet; sptr_ifnet = sptr_ifnet->if_next)#endif        {        if(sptr_ifnet == (struct ifnet*)intf &&               sptr_ifnet->if_index == interface_index)        {            for            (            sptr_ifaddr = sptr_ifnet->if_addrlist;            sptr_ifaddr;            sptr_ifaddr = sptr_ifaddr->ifa_next            )            {                IFP_TO_IA (sptr_ifnet, sptr_interface_address);                if (sptr_interface_address == NULL)                {                continue;                }                /* check the sin family type for Internet */                if (sptr_interface_address->ia_addr.sin_family != AF_INET)                {                    continue;                }                if (sptr_interface_address->ia_addr.sin_addr.s_addr ==                    ip_address)                {                    if (sptr_ifnet->if_flags & IFF_UP)                    {                        splx (s);                        return 2;                    }                    else                    {                        splx(s);                        return 1;                    }                }            } /* for */           } /* if */        }     /* for */    splx (s);    return 0;}#endif /*__OSPF_ROUTER_STACK__*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线观看| 日韩一区二区免费高清| 高清免费成人av| 精品一区二区久久| 蜜臀久久久99精品久久久久久| 天堂在线一区二区| 天天操天天干天天综合网| 亚洲国产成人av好男人在线观看| 精品中文av资源站在线观看| 日韩成人一级大片| 久久99精品久久久久婷婷| 久久 天天综合| 国产精品一级黄| 成人免费视频播放| 91麻豆国产香蕉久久精品| 在线观看中文字幕不卡| 欧美视频在线观看一区二区| 777xxx欧美| 久久综合网色—综合色88| 国产日韩精品久久久| 国产精品污www在线观看| 中文字幕视频一区| 亚洲18色成人| 久久99日本精品| 成人爽a毛片一区二区免费| 99精品欧美一区二区三区小说| 色综合天天综合网天天看片| 8v天堂国产在线一区二区| 精品国产免费久久| 中文字幕一区二区三区不卡在线 | 久久久亚洲高清| 国产欧美一区二区三区网站| 亚洲欧美视频一区| 日本成人在线视频网站| 国产成人av一区| 国产日韩精品视频一区| 一区二区三区在线视频观看| 日韩国产一二三区| 国产乱码精品一区二区三区忘忧草 | 中文字幕欧美日韩一区| 伊人开心综合网| 国内偷窥港台综合视频在线播放| av资源站一区| 欧美一级高清片在线观看| 中文字幕av一区二区三区免费看| 亚洲午夜精品久久久久久久久| 免费日韩伦理电影| 99r精品视频| 欧美成人国产一区二区| 亚洲视频在线一区二区| 丝袜美腿一区二区三区| 国产999精品久久| 在线播放国产精品二区一二区四区| 久久综合色鬼综合色| 一级女性全黄久久生活片免费| 精品综合久久久久久8888| 色88888久久久久久影院野外| 精品国产不卡一区二区三区| 亚洲国产精品一区二区久久| 国产精品一二三在| 欧美日韩精品系列| 国产精品久久久久9999吃药| 日本不卡一区二区| 欧美mv和日韩mv国产网站| 亚洲精品中文字幕乱码三区| 国产精品自产自拍| 欧美丰满少妇xxxxx高潮对白| 国产女主播在线一区二区| 美女久久久精品| 欧美在线视频全部完| 欧美日韩激情一区二区三区| 国产精品久久午夜| 国产在线精品免费av| 欧美日韩国产系列| 亚洲精品免费视频| 成人理论电影网| 亚洲精品一线二线三线无人区| 日产欧产美韩系列久久99| 日本高清不卡aⅴ免费网站| 国产精品免费视频一区| 免费观看在线综合| 欧美日本在线观看| 亚洲精品久久7777| 91麻豆视频网站| 国产精品久久久久久户外露出| 国产精品一区2区| 精品成人在线观看| 久久精品国产亚洲a| 欧美日韩国产成人在线免费| 亚洲另类在线一区| 91麻豆6部合集magnet| 中文字幕二三区不卡| 国产成人精品影院| 国产拍欧美日韩视频二区| 精品一二三四在线| 亚洲永久免费av| 91国产丝袜在线播放| 中文字幕字幕中文在线中不卡视频| 丰满少妇在线播放bd日韩电影| 久久一夜天堂av一区二区三区| 久久精品国产精品亚洲红杏| 欧美成人伊人久久综合网| 激情欧美一区二区| 精品国产乱码久久| 狠狠色丁香婷综合久久| 337p日本欧洲亚洲大胆精品| 国产在线精品一区二区| 欧美韩日一区二区三区四区| 成人深夜在线观看| 亚洲欧洲日韩在线| 91国偷自产一区二区三区观看| 一区二区三区不卡视频在线观看| 日本乱码高清不卡字幕| 亚洲国产精品麻豆| 日韩一级完整毛片| 国内精品免费在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 91亚洲永久精品| 性做久久久久久久久| 日韩精品一区二区三区在线观看| 久久国产精品露脸对白| 国产欧美一区二区精品忘忧草| 成人国产精品免费观看视频| 亚洲欧美日韩综合aⅴ视频| 欧美影院精品一区| 青草国产精品久久久久久| 久久久久国产一区二区三区四区 | 国产精品美女久久久久aⅴ | 国产欧美一区视频| 91在线观看地址| 午夜精品久久久久久久久久久 | 欧美sm极限捆绑bd| 国产福利视频一区二区三区| 中文字幕色av一区二区三区| 欧美日产国产精品| 国产乱码精品一品二品| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩日日摸| 国产一区二区三区日韩| 亚洲人精品午夜| 欧美一区二区三区视频免费播放| 国产精品一区二区三区网站| 亚洲美女屁股眼交3| 欧美一卡二卡三卡| 成人午夜激情影院| 三级一区在线视频先锋| 久久精品视频免费观看| 欧美在线免费播放| 激情深爱一区二区| 亚洲综合一区在线| 久久嫩草精品久久久精品| 色综合天天综合网国产成人综合天 | 椎名由奈av一区二区三区| 亚洲伦理在线精品| 精品裸体舞一区二区三区| 91免费在线播放| 精久久久久久久久久久| 一区二区免费在线播放| 久久一区二区三区四区| 在线观看国产91| 国产精品亚洲综合一区在线观看| 一区二区三区**美女毛片| 久久久精品国产免大香伊| 欧美精品在线一区二区三区| 成人丝袜18视频在线观看| 秋霞电影网一区二区| 一区视频在线播放| 精品乱人伦小说| 欧美三级电影精品| 成人妖精视频yjsp地址| 久久精品国产精品亚洲精品| 亚洲午夜av在线| 国产精品三级视频| 欧美哺乳videos| 欧美日本乱大交xxxxx| 99久久婷婷国产综合精品| 久久国产精品免费| 天堂蜜桃91精品| 亚洲综合成人在线| 亚洲视频你懂的| 中文字幕高清一区| 久久久噜噜噜久久人人看 | 国产精品三级视频| 26uuu精品一区二区| 欧美一区二区福利在线| 欧美私人免费视频| 91玉足脚交白嫩脚丫在线播放| 国产精品综合视频| 久久99国产精品尤物| 一本久久a久久精品亚洲| 成人在线视频一区二区| 国产一区二区在线电影| 久久99精品国产| 久久国产麻豆精品| 日本人妖一区二区| 石原莉奈在线亚洲二区| 天堂av在线一区| 日韩avvvv在线播放| 日本午夜精品视频在线观看| 天天综合色天天|