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

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

?? ospf_vx_ip_adaptation.c

?? vxworks下ospf協議棧
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* 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;                       }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产一区二区三区香蕉| 亚洲国产精品久久艾草纯爱 | 水野朝阳av一区二区三区| 午夜免费欧美电影| 激情五月激情综合网| 99久久久久久| 欧美精品三级日韩久久| 欧美精品一区男女天堂| 日韩理论片一区二区| 亚洲成av人片在线| 国产一区二区精品在线观看| 91亚洲精品乱码久久久久久蜜桃| 欧美日韩国产在线观看| 国产免费久久精品| 亚洲国产精品一区二区www| 国产精品一线二线三线精华| 91成人免费在线| 欧美成人免费网站| 亚洲夂夂婷婷色拍ww47| 紧缚奴在线一区二区三区| 99久久久精品| 欧美精品一区二区三区蜜臀| 亚洲自拍偷拍图区| 久久99精品一区二区三区 | 亚洲伦在线观看| 成人一区二区三区视频| 欧洲亚洲精品在线| 久久亚洲一级片| 午夜久久久影院| 成人a级免费电影| 欧美性淫爽ww久久久久无| 久久久国产一区二区三区四区小说 | 伊人性伊人情综合网| 久久99精品久久久久久动态图| 91色porny蝌蚪| 国产性做久久久久久| 日韩和欧美一区二区| av激情综合网| 国产视频一区二区在线| 免费美女久久99| 91成人在线免费观看| 国产精品国产三级国产普通话三级 | 波多野结衣中文一区| 精品久久免费看| 天堂久久久久va久久久久| 91婷婷韩国欧美一区二区| 精品国产a毛片| 日韩高清电影一区| 欧美视频在线一区| 国产精品久久久久久福利一牛影视 | 色噜噜狠狠一区二区三区果冻| 久久久久久久久久久久久女国产乱 | 99re热视频精品| 日韩精品一区二区三区三区免费 | 日韩美女一区二区三区四区| 亚洲成av人片在www色猫咪| 久久99精品视频| 欧美日韩亚洲综合一区二区三区 | 91在线视频免费观看| 欧美一区三区四区| 亚洲电影一区二区三区| 色天使久久综合网天天| 国产精品久久久久久久久久久免费看 | 国产大陆亚洲精品国产| 5858s免费视频成人| 亚洲乱码一区二区三区在线观看| a级高清视频欧美日韩| 中文av字幕一区| 久久99精品久久久久久国产越南| 欧美酷刑日本凌虐凌虐| 亚洲影视资源网| 色婷婷综合五月| 一区二区在线观看免费| 91精彩视频在线观看| 国产精品久久久久久一区二区三区| 大胆亚洲人体视频| 国产精品午夜免费| av在线不卡观看免费观看| 综合中文字幕亚洲| 色婷婷精品久久二区二区蜜臂av| 国产精品久久久久久久久免费樱桃| 国产精品一区二区三区四区| 国产日韩欧美制服另类| 丰满亚洲少妇av| 国产精品乱码一区二区三区软件| 成人三级在线视频| 中文字幕一区av| 欧美性受xxxx黑人xyx性爽| 日韩在线一区二区三区| 欧美成人video| 国产电影一区二区三区| 国产精品福利在线播放| 91亚洲永久精品| 亚洲小说春色综合另类电影| 3d动漫精品啪啪1区2区免费| 日韩不卡手机在线v区| 欧美午夜电影网| 美女视频免费一区| 国产午夜精品久久| www.亚洲激情.com| 亚洲国产欧美日韩另类综合| 91精品视频网| 国产乱妇无码大片在线观看| 国产精品三级电影| 欧美探花视频资源| 色94色欧美sute亚洲线路二| 亚洲欧美视频在线观看视频| 成人免费观看av| 国产精品国产三级国产aⅴ入口 | 国产午夜久久久久| 国产suv精品一区二区883| 亚洲欧美另类图片小说| 欧美日韩在线播| 激情文学综合丁香| 亚洲精品中文在线观看| 日韩一区二区三区电影| 另类综合日韩欧美亚洲| 国产欧美久久久精品影院| 欧洲视频一区二区| 精品一区二区精品| 亚洲男人的天堂在线观看| 欧美一卡二卡三卡| av高清不卡在线| 久久精品国产**网站演员| 中文字幕一区二区5566日韩| 777午夜精品免费视频| 成人午夜免费电影| 日韩二区三区在线观看| 国产精品美女www爽爽爽| 欧美肥妇free| 成人黄色777网| 麻豆成人免费电影| 亚洲欧美日韩国产另类专区 | 久久av资源网| 亚洲免费av在线| 久久蜜桃一区二区| 欧美日韩aaaaaa| 成人黄色a**站在线观看| 免费视频最近日韩| 樱花影视一区二区| 欧美一区二区在线观看| 日韩精品电影在线观看| 国产精品国产三级国产普通话三级| 欧美放荡的少妇| 色综合网色综合| 国内精品伊人久久久久av影院| 依依成人综合视频| 亚洲国产精品二十页| 欧美色成人综合| 粉嫩嫩av羞羞动漫久久久| 奇米在线7777在线精品| 一区二区三区中文免费| 久久精品网站免费观看| caoporn国产一区二区| 国产麻豆精品一区二区| 日韩精品每日更新| 亚洲成人综合在线| 中文字幕一区二区三区av| 久久久久久久久一| 日韩视频一区二区三区在线播放| 91丨九色丨黑人外教| 国产99精品在线观看| 蜜桃久久av一区| 午夜欧美电影在线观看| 亚洲蜜臀av乱码久久精品| 欧美国产一区二区| 精品久久久久香蕉网| 欧美电影在线免费观看| 91麻豆视频网站| 成人激情av网| 国产成人无遮挡在线视频| 捆绑变态av一区二区三区| 日韩经典一区二区| 一区二区三区在线免费播放| 制服丝袜一区二区三区| 欧美色涩在线第一页| 欧美午夜一区二区三区免费大片| 91蝌蚪porny九色| 91丨九色丨蝌蚪富婆spa| 91丨国产丨九色丨pron| 91免费在线播放| av电影一区二区| 色综合久久中文综合久久97| 色综合久久精品| 日本精品视频一区二区三区| 91丨porny丨国产| 色婷婷综合久久久久中文| 成人精品一区二区三区四区 | 3d动漫精品啪啪| 777色狠狠一区二区三区| 欧美一区二区三区精品| 日韩欧美激情一区| 日韩一区二区在线看| 日韩女优视频免费观看| 久久久99精品免费观看不卡| 久久久www成人免费无遮挡大片| 国产午夜亚洲精品理论片色戒| 国产精品毛片无遮挡高清| 国产精品乱码久久久久久| 亚洲女同一区二区|