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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ospf_vx_ip_adaptation.c

?? vxworks下ospf協(xié)議棧
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* ospf_vx_ip_adaptation.c *//* Copyright 2000-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02h,28may03,agi  Changed type of variable mutex_acquired to STATUS02g,12may03,asr  Changes to make OSPF virtual stack compatible02f,26may03,htm  Replacing the magic number 1000 with OSPF_MAX_PKT_SIZE.02e,14may03,agi  Changed RWOS semaphores to vxWorks semaphores02d,10feb03,hme  Fixed the solution to SPR#81451 to work on Pentium02c,15jan03,hme  Fixed  SPR#69807 and SPR#7216702b,15jan03,hme  Fixed  SPR#8145102c,26oct02,hme  Fix TSR#29522802b,21oct02,htm  Apply fix for SPR#83274 OSPF is not updating properly the PPP                 Interface routes to neighboring routers 02a,08oct02,agi  Fixed compiler warnings11,24jun02,kc  Removed reference to low-level interface handler in                ospf_indicate_lower_level_interface_state_change().10,13apr02,kc  Changed ospf_indicate_lower_level_interface_state_change() to                step interface state machine to bring down the interface so that               the mib api can also updates the interface operational status and               stats.09,15feb02,kc  Changed printf statement to OSPF_PRINTF_DEBUG.08,16feb02,kc  Added ospf_if_status import statement to remove compiler warning.07,06feb02,bt  look for changes in comment  __UNNUMBERED_LINK__ver1.006,22sep01,kc  Removed references to port number.05,22sep01,kc  Fixed raw socket transmit and receive routines.04,19jan01,jkw Added raw_sockets to replace direct call to IP. The purpose of               this is for protection domains.  There will be no more direct                calls to IP03,23aug01,jkw Fixed compiler warnings.02,15may01,aos Added memset to ospf_receive_message_buffer01,3may01,jkw  change to ospf_indicate_lower_level_interface_state_change to use               ospf_reset_interface_variables_and_timers_and_destroy_all_              _associated_neighbor_connections*//*DESCRIPTIONospf_vx_ip_adaptation.c is used for sending and receiving packets.  This file contains the functions to interact with Vxworks input and output functions.  This file contains the functions for using raw sockets or direct calls to IP.This file is used whenever an OSPF packet is sent or received.*/#include <vxWorks.h>#include <net/mbuf.h>#include <sys/socket.h>#include <net/socketvar.h>#include <net/protosw.h>#include <errno.h>#include <sys/stat.h>#include <netinet/in.h>#include <net/if.h>#include <net/route.h>#include <netinet/in_var.h>#include <netinet/in_pcb.h>#include <netinet/in_systm.h>#include <netinet/ip.h>#include <netinet/ip_var.h>#include <netLib.h>#include "ospf.h"#if defined (__OSPF_VIRTUAL_STACK__)#include "ospf_vs_lib.h"#endif /* __OSPF_VIRTUAL_STACK__ *//*raw socket - Added socket library files to resolve undefined externs jkw*/#include <sockLib.h>#include <inetLib.h>#include <stdioLib.h>#include <strLib.h>#include <hostLib.h>#include <ioLib.h>#include <selectLib.h>/*raw socket - End of changes*/ULONG   ospf_sendspace = 8192;ULONG   ospf_recvspace = 8192;BYTE    ospf_receive_message_buffer[8192];struct  mbuf m_block;/* HME Fix SPR#81451 Begin */#define ENABLE_IP_HDRINCL  TRUE   /* if ENABLE_IP_HDRINCL is defined, ospf will construct and send an entire IP packet to the IP layer */#if defined(ENABLE_IP_HDRINCL)#define IPHL 	sizeof (struct ip)  /* IP header length */void ipHeaderCreate(    int ,               /* protocol number	*/    struct in_addr * ,	/* source ip address 	*/    struct in_addr * ,	/* dest ip address	*/    struct ip *		 ,	/* internet header 	*/    int			        /* datagram size 	*/    );#endif/* HME Fix SPR#81451 End *//* HME Fix SPR#69807 & SPR#72167  Begin*/#if defined(ENABLE_IP_HDRINCL)#define TOS_BYTE_VALUE    0xC0    /* The TOS Byte    *    * 0     1     2     3     4     5     6     7    * +-----+-----+-----+-----+-----+-----+-----+-----+    * |                 |     |     |     |     |     |    * |   PRECEDENCE    |  D  |  T  |  R  |  0  |  0  |    * |                 |     |     |     |     |     |    * +-----+-----+-----+-----+-----+-----+-----+-----+    *    * Bits 0-2:  Precedence.    * Bit    3:  0 = Normal Delay,      1 = Low Delay.    * Bits   4:  0 = Normal Throughput, 1 = High Throughput.    * Bits   5:  0 = Normal Relibility, 1 = High Relibility.    * Bit  6-7:  Reserved for Future Use.    *    *        Precedence    *    *         111 - Network Control    *         110 - Internetwork Control    *         101 - CRITIC/ECP    *         100 - Flash Override    *         011 - Flash    *         010 - Immediate    *         001 - Priority    *         000 - Routine    */#endif/* HME Fix SPR#69807 & SPR#72167  End */IMPORT int ospf_if_status (unsigned long intf, int interface_index,                           unsigned long ip_address);/* globals */static struct sockaddr_in ospf_src = { sizeof(ospf_src), AF_INET };/*raw socket - Created socket interface function to be called by a task *that reads from the socket. jkw*//************************************************************************//* Added change as per TMS PR # 1652 *//* for tOspfRecv: added local prototype for received packet processing routine */int ospf_vx_ip_receive_packet (OSPF_PACKET *ospf_packet, ULONG rcvif_handle);/**************************************************************************************** ospf_vx_ip_receive_socket_input - OSPF packet received routine** This is the entry point for "tOspfInput" task that is created in ospf_intialize_router()* (see ospf_initialization.c file). It waits for packet on the raw socket using the* select() call. Once select() returns, it calls recvfrom() to read the data from* the socket and the ospf_router_rx_packet() to process the received packet.* Unlike the tranditional receive routine that processes mbuf, it is not necssary to* enqueue the received packet to a linked list and have a separate task to do the actual* packet processing functionality. This is because the "tOspfInput" task always pend on a* set of sockets waiting for data and this task is receiving data independent of the* "tNetTask".*/int ospf_vx_ip_receive_socket_input (void)    {    struct ip          *ip_header;    struct fd_set      readFd;    struct sockaddr    from_sockaddr;    struct sockaddr_in *pFrom_sockaddr;    struct in_ifaddr   *recvif;    OSPF_INTERFACE     *sptr_interface = NULL;    OSPF_INTERFACE     *sptr_next_interface = NULL;#if defined (__UNNUMBERED_LINK__)       /* __UNNUMBERED_LINK__ver1.0 */    OSPF_INTERFACE *    sptr_saved_interface;    ULONG               source_address = 0x00000000L;#endif  /* __UNNUMBERED_LINK__ver1.0 */    STATUS  mutex_acquired;    int       recvLen;    int       recv_bufsize;    int       sockaddr_len;    int       maxFd;    ULONG     intf_addr;    ULONG     destination_address = 0x00000000;    int       spl;	u_short   original_if_index;  /* introduced for fixing TSR #295228 */    maxFd = ipSock;    /* asr: set virtual stack context. Need to set the stack context only       once since call to virtualStackNumTaskIdSet() will add myStackNum        as a task variable to the input task. Therefore, all functions called        within the context of the input task will use the correct value for       myStackNum.     */    #if defined (VIRTUAL_STACK)        virtualStackNumTaskIdSet (ospf.ospf_vsid);    #endif /* VIRTUAL_STACK */    for (;;)        {        /* zero out the file descriptor structure */        FD_ZERO (&readFd);        /* tell 'em which file descriptor that we wanna to listen */        FD_SET (ipSock, &readFd);        /* wait for select to fire, wait indefinitely for input on sockets */        if (select(maxFd+1, &readFd, NULL, NULL, NULL) == ERROR)            continue;        /* got it. Figure out if it is the file descriptor that we want to listen */        if (FD_ISSET (ipSock, &readFd))            {            /* read data into the flat buffer. Unlike mbuf, it is a valid to assume             * that the data read from the socket is contiguous, i.e. a complete             * OSPF packet             */            recv_bufsize = sizeof(ospf_receive_message_buffer);            memset( (char *)&from_sockaddr, 0, sizeof(from_sockaddr));            memset(ospf_receive_message_buffer, 0, recv_bufsize);            sockaddr_len = sizeof(from_sockaddr);            recvLen = recvfrom(ipSock, (char *)ospf_receive_message_buffer, recv_bufsize, 0,                               (struct sockaddr *)&from_sockaddr, &sockaddr_len);            if (sockaddr_len)                {                from_sockaddr.sa_family = AF_INET;                from_sockaddr.sa_len = sockaddr_len;                }            /* recvfrom returns number of bytes read (between 1 to recv_buffsize) or             * ERROR if file descriptor is not valid             */            if ( recvLen < 1 )                {                continue;                }            /* we are reading from raw socket. Data received contains ip header             * follows by the ospf packet. First get the pointer to the ip header             */            ip_header = (struct ip *)ospf_receive_message_buffer;            /* associate the received packet with the correct ospf interface as descirbed             * in section 8.2 of the ospf specification.             */                        destination_address = ip_header->ip_dst.s_addr;                        destination_address = net_to_host_long(destination_address);            if (IN_MULTICAST (destination_address))                {                /* first try to locate the point-to-point interface using the given                 * destination address from the recvfrom()                 * NOTE: ifa_ifwithdstaddr() and ifa_ifwithnet() returns pointer to                 * the ifaddr structure. Can't figure out how to get the handler to                 * in_ifaddr structure from ifaddr. Typecasting the returned type                 * for both functions to pointer to in_ifaddr structure may seems                 * to be inappropriate, but this is also done in ip_output() and                 * ip_dooptions() stack code. Thus, I think it is ok to do so...                 */                 /* sin_port and sin_zero needs to be zero'd before calling ifa_ifwithnet                    Otherwise, binary compare of structures may fail.                 */ 				/* hme - TSR #295228 fix for swapping two Rx interfaces Begin */                /* retrive if_index from socketaddr_in. 				   First 4 bytes of sin_zero contains if_index				*/				 original_if_index = *((unsigned int *)&(((struct sockaddr_in *)&from_sockaddr)->sin_zero[0]));                 /* hme - TSR #295228 fix for swapping two Rx interfaces End*/				                  recvif = (struct in_ifaddr *)NULL;                                 pFrom_sockaddr = (struct sockaddr_in *)&from_sockaddr;                                  pFrom_sockaddr->sin_port = 0;				 				 /* htm - SPR #83274 fix Begin */                 memset(&(pFrom_sockaddr->sin_zero), 0, 8*sizeof(char));                 /* htm - SPR #83274 fix End */                                  spl = splnet();                 recvif = (struct in_ifaddr *)ifa_ifwithdstaddr(&from_sockaddr);                 splx(spl);                 if ( recvif == NULL)                 {                     /* recvif not point-to-point. Try to find the recvif on a specific                      * network. If many choices, the most specific one should be                      * returned by ifa_ifwithnet()                      */					 					 /* htm - SPR #83274 fix Begin */                     spl = splnet();                     recvif = (struct in_ifaddr *)ifa_ifwithnet(&from_sockaddr);                     splx(spl);                     /* htm - SPR #83274 fix End */                     if ( recvif == NULL)                      {                         OSPF_PRINTF_DEBUG(OSPF_ALARM_PRINTF,                                 "dropped recvpkt - recvif not found!\n");                         continue;                     }                 }				/* hme - TSR #295228 fix for swapping two Rx interfaces Begin */				if (recvif->ia_ifa.ifa_ifp->if_index != original_if_index){							/*Interface did not match*/                    OSPF_PRINTF_DEBUG(OSPF_ALARM_PRINTF,                             "dropped recvpkt - packet did not match receive interface!\n");					continue;				}				/* hme - TSR #295228 fix for swapping two Rx interfaces End */                /* lock mutex for mutual exclusion to the ospf data structure */                mutex_acquired = semTake (ospf_global_mutex, WAIT_FOREVER);                if (mutex_acquired == ERROR)                    {                    continue;                    }                for (sptr_interface = ospf.sptr_interface_list;                      sptr_interface != NULL;                     sptr_interface = sptr_next_interface)                    {                    sptr_next_interface = sptr_interface->sptr_forward_link;                    intf_addr = sptr_interface->address;                    /* find interface matches the subnet of the sender. If there                     * are many possible interfaces, choose the most specific one,                     * i.e. the one with the longest netmask                     */                    if (intf_addr == net_to_host_long(recvif->ia_addr.sin_addr.s_addr))                        {                        break;                        }                    }                }            else    /* (IN_MULTICAST (destination_address)) */                {                /* lock mutex for mutual exclusion to the ospf data structure */                mutex_acquired = semTake (ospf_global_mutex, WAIT_FOREVER);                if (mutex_acquired == ERROR)                    {                    continue;                    }#if defined (__UNNUMBERED_LINK__)       /* __UNNUMBERED_LINK__ver1.0 */                                sptr_saved_interface = NULL;                /* it is unicast - got destination address in the ip header */                for (sptr_interface = ospf.sptr_interface_list;                      sptr_interface != NULL;                     sptr_interface = sptr_interface->sptr_forward_link)                    {                    destination_address = ip_header->ip_dst.s_addr;                    destination_address = net_to_host_long(destination_address);                    source_address = ip_header->ip_src.s_addr;                    source_address = net_to_host_long(source_address);                                        if (sptr_interface->address == 0)        /* unnumbered link*/                       {                       intf_addr = sptr_interface->unnumbered_router_id;                       }                    else                       {                       intf_addr = sptr_interface->address;                       }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产成人午夜在线一区| 99久久国产综合精品麻豆| 欧美在线色视频| 亚洲午夜成aⅴ人片| 欧美三级资源在线| 美国三级日本三级久久99| 欧美一区二区观看视频| 久久国产精品免费| 久久久99免费| av在线这里只有精品| 亚洲激情在线激情| 欧美丰满嫩嫩电影| 久久国内精品自在自线400部| 久久影视一区二区| 91在线观看下载| 亚洲国产综合色| 精品三级在线观看| www.日韩av| 日韩电影在线免费| 国产欧美一区在线| 欧美少妇bbb| 国模娜娜一区二区三区| 国产精品久久久久一区二区三区共| 91社区在线播放| 日韩制服丝袜先锋影音| 国产色一区二区| 欧美日韩国产电影| 成人一级黄色片| 天天综合色天天综合色h| 久久久久成人黄色影片| 欧美午夜精品一区二区蜜桃| 国产资源在线一区| 夜夜精品浪潮av一区二区三区| 日韩一区二区三区电影| fc2成人免费人成在线观看播放| 午夜精品视频一区| 国产精品麻豆欧美日韩ww| 欧美裸体一区二区三区| 成人国产精品免费网站| 日韩国产成人精品| 自拍偷拍欧美激情| 26uuu国产电影一区二区| 欧美亚洲国产一区二区三区| 国产成人亚洲精品青草天美| 午夜伊人狠狠久久| 国产精品成人免费在线| 精品国产伦一区二区三区观看体验| 99麻豆久久久国产精品免费| 久久国产精品第一页| 亚洲一卡二卡三卡四卡五卡| 国产三级三级三级精品8ⅰ区| 欧美视频在线观看一区二区| 99天天综合性| 国产福利电影一区二区三区| 美日韩一级片在线观看| 亚洲一区二区三区免费视频| 国产精品私人自拍| 久久精品日韩一区二区三区| 国产精品小仙女| 日本一区二区三区免费乱视频 | 精品国产一区二区精华| 欧美在线|欧美| av亚洲精华国产精华精华| 国精产品一区一区三区mba视频 | 国产精品一区二区三区网站| 蜜桃视频在线一区| 三级影片在线观看欧美日韩一区二区| 亚洲最大成人综合| 成人欧美一区二区三区视频网页| 国产调教视频一区| 久久精品亚洲精品国产欧美| 2023国产精华国产精品| 91精品国产日韩91久久久久久| 欧美日韩精品一区视频| 欧美午夜精品一区| 欧美老肥妇做.爰bbww视频| 欧美性色aⅴ视频一区日韩精品| jlzzjlzz亚洲女人18| 99久久精品国产一区| 91美女在线看| 色偷偷久久人人79超碰人人澡| 色综合中文字幕| 在线看一区二区| 欧美精品欧美精品系列| 欧美在线观看一区二区| 精品视频色一区| 91超碰这里只有精品国产| 在线不卡欧美精品一区二区三区| 日韩手机在线导航| 久久人人爽人人爽| 国产精品电影院| 伊人夜夜躁av伊人久久| 亚洲电影一区二区| 奇米色777欧美一区二区| 奇米777欧美一区二区| 精品一区二区在线看| 国产大陆亚洲精品国产| 91麻豆自制传媒国产之光| 欧美亚洲综合一区| 日韩一区二区三区在线视频| 精品国产123| 自拍偷拍亚洲激情| 日本成人在线网站| 国产999精品久久久久久| 日本道在线观看一区二区| 91精品综合久久久久久| 久久久久久免费毛片精品| 亚洲美女屁股眼交3| 日韩国产在线观看一区| 国产九色sp调教91| 在线这里只有精品| 26uuu久久综合| 一区二区三区视频在线看| 人人超碰91尤物精品国产| 国产精品亚洲第一区在线暖暖韩国| www.色精品| 日韩视频免费观看高清完整版 | 国产精品久久99| 一区二区三区在线视频免费观看| 亚洲国产日韩综合久久精品| 蜜桃av一区二区三区| 国产.欧美.日韩| 91精品欧美综合在线观看最新| 中文字幕国产一区| 日韩电影在线免费| 日本韩国视频一区二区| 精品国产伦一区二区三区免费| 亚洲欧美日韩人成在线播放| 精品系列免费在线观看| 欧美性大战久久久| 欧美国产激情二区三区| 日本不卡一区二区三区| 91猫先生在线| 欧美国产日韩精品免费观看| 天堂va蜜桃一区二区三区 | 欧美系列亚洲系列| 国产精品午夜电影| 激情五月婷婷综合网| 欧美剧情片在线观看| 国产精品成人免费在线| 国产一区91精品张津瑜| 欧美三级日韩在线| 亚洲人成网站在线| 懂色av噜噜一区二区三区av| 日韩一区二区三区电影| 亚瑟在线精品视频| 91精品办公室少妇高潮对白| 国产亚洲精品资源在线26u| 男男成人高潮片免费网站| 91久久精品国产91性色tv| 国产午夜久久久久| 麻豆精品视频在线观看视频| 91精品中文字幕一区二区三区| 亚洲自拍偷拍综合| 色婷婷久久久久swag精品 | 亚洲人精品一区| 成人av电影在线播放| 久久精品亚洲国产奇米99| 极品少妇xxxx精品少妇偷拍| 日韩限制级电影在线观看| 日韩激情视频网站| 欧美一区二区免费视频| 日韩和欧美的一区| 日韩一区国产二区欧美三区| 水野朝阳av一区二区三区| 欧美日韩精品是欧美日韩精品| 亚洲一区二区三区四区在线免费观看 | 91精品免费在线观看| 午夜视频一区在线观看| 欧美日韩第一区日日骚| 婷婷六月综合亚洲| 91精品国产欧美一区二区| 日本免费在线视频不卡一不卡二| 在线成人免费视频| 久久精品国产一区二区| 日韩精品一区二区三区在线 | 亚洲区小说区图片区qvod| 国产乱码精品1区2区3区| 精品日韩欧美在线| 国产精品88av| 国产精品网站在线观看| 波多野结衣亚洲一区| 亚洲欧美综合网| 色女孩综合影院| 午夜不卡av免费| 日韩一区二区在线观看视频| 精品一区二区三区日韩| 久久久99久久| 色婷婷av久久久久久久| 午夜精品福利一区二区三区av | 久久精品视频网| 91丨国产丨九色丨pron| 一区二区三区电影在线播| 欧美精品免费视频| 国产一区在线观看视频| 国产精品久久三区| 欧美日韩精品一区二区天天拍小说| 久久精工是国产品牌吗| 综合久久给合久久狠狠狠97色 | 亚洲精选免费视频|