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

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

?? iflib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* ifLib.c - network interface library *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------03h,10may02,kbw  making man page edits03g,09may02,wsl  fix doc formatting error03f,08jan02,vvv  fixed ifRouteDelete to use correct netmask (SPR #33381)03e,07dec01,rae  merge from synth ver 03r (SPR #70269)03d,05nov01,vvv  fixed compilation warning03c,15oct01,rae  merge from truestack ver 03p, base 03b (ROUTER_STACK)03b,12mar99,c_c  Doc: updated ifAddrGet, ifFlagSet() and ifDeleRoute 		(SPRs #21401, 9146 and 21076).03a,06oct98,ham  changed API for ifAddrAdd() (SPR22267)02a,19mar98,spm  fixed byte ordering in ifRouteDelete() routine; changed to                  use mRouteDelete() to support classless routing (SPR #20548)01z,16apr97,vin  changed SOCK_DGRAM to SOCK_RAW as udp can be scaled out.		 fixed ifRouteDelete().01y,16oct96,dgp  doc: add explanations to ifFlagsSet per SPR 733701x,11jul94,dzb  Fixed setting of errno in ifIoctlCall() (SPR #3188).                 Fixed ntohl transfer in ifMaskGet() (SPR #3334).01w,19oct92,jmm  added ntohl () to ifMaskGet() to make it symetrical w/ifMaskSet01v,02sep93,elh  changed ifunit back to berkeley orig to fix spr (1516).01u,11aug93,jmm  Changed ioctl.h and socket.h to sys/ioctl.h and sys/socket.h01t,05feb93,jag  Changed call to inet_ntoa to inet_ntoa_b in ifInetAddrToStr,		 changed ifRouteDelete accordingly SPR# 181401s,20jan93,jdi  documentation cleanup for 5.1.01r,18jul92,smb  Changed errno.h to errnoLib.h.01q,26may92,rrr  the tree shuffle		  -changed includes to have absolute path from h/01p,10dec91,gae  added includes for ANSI.01o,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -fixed #else and #endif		  -changed copyright notice01n,01may91,elh	 added htonl to ifMaskSet because network wants mask                 to be in network byte order.01m,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;	   +elh	 added ifunit() from if.c (elh); doc review by dnw.01l,18jan91,jaa	 documentation.01k,26jun90,hjb  moved ifShow, etc. to netShow.c.01j,18mar90,hjb  de-linted.  minor syntax cleanup.01i,14mar90,jdi  documentation cleanup.01h,07aug89,gae  undid 01e -- fixed if_bp.c.01g,03aug89,hjb  fixed ifShow to work with "bp" interfaces which                 use incompatible "ifp->if_name" convention (unit number is                 for some reason appended to the if_name itself?).01f,30jul89,gae  removed varargs stuff; internal name changes.		 documentation tweaks.  lint.01e,28jul89,hjb  added routines ifAddrGet, ifBroadcastGet, ifDstAddrGet,                 ifAddrParamGet, ifMaskGet, ifFlagChange, ifFlagGet,		 ifMetricSet, ifMetricGet, ifIoctl, ifSetIoctl, ifGetIoctl,		 ifIoctlCall, and modified ifEtherPrint.01d,27jul89,hjb  added routines ifShow, ifFlagSet, ifDstAddrSet, ifAddrPrint,		 ifFlagPrint, ifEtherPrint, ifRouteDelete.01c,18aug88,gae  documentation.01b,30may88,dnw  changed to v4 names.01a,28may88,dnw  extracted from netLib.*//*DESCRIPTIONThis library contains routines to configure the network interface parameters.Generally, each routine corresponds to one of the functions of the UNIXcommand \f3ifconfig\fP.To use this feature, include the following component:INCLUDE_NETWRS_IFLIBINCLUDE FILES: ifLib.hSEE ALSO: hostLib*/#include "vxWorks.h"#include "stdio.h"#include "netinet/in.h"#include "net/if.h"#include "netinet/if_ether.h"#include "sys/ioctl.h"#include "ioLib.h"#include "inetLib.h"#include "string.h"#include "netinet/in_var.h"#include "errnoLib.h"#include "sockLib.h"#include "hostLib.h"#include "routeLib.h"#include "unistd.h"#include "ifLib.h"#include "m2Lib.h"#include "arpLib.h"#include "routeEnhLib.h"#ifdef DEBUG#include "logLib.h"#endif#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#include "netinet/vsRadix.h" 	/* for rt_tables definition */#include "netinet/vsIp.h" 	/* for _in_ifaddr definition */#endif /* VIRTUAL_STACK *//* * macro to convert interface address into character string representation. * The return value is a_ip_addr. */#define ifInetAddrToStr(ifAddr,a_ip_addr) \((inet_ntoa_b(((struct sockaddr_in *)(ifAddr))->sin_addr,a_ip_addr)),a_ip_addr)#define RT_ARP          0x100                   /* arp route entry *//* * Imported global variables */#ifndef VIRTUAL_STACKIMPORT struct ifnet 		*ifnet;	/* global pointer to all interfaces */IMPORT struct in_ifaddr 	*in_ifaddr; /* global pointer to addresses */#endif /* VIRTUAL_STACK */IMPORT STATUS _arpCmd (int, struct in_addr *, u_char *, int *);/* forward static functions */static STATUS ifAddrParamGet (char *interfaceName, int code, char *address);static STATUS ifIoctl (char *interfaceName, int code, int arg);static STATUS ifIoctlSet (char *interfaceName, int code, int val);static STATUS ifIoctlGet (char *interfaceName, int code, int *val);static STATUS ifIoctlCall (int code, struct ifreq *ifrp);LOCAL int routeNodeDelete ();LOCAL int _routeNodeDelete (struct rtentry * pRt, int * pDeleted);/********************************************************************************* ifUnnumberedSet - configure an interface to be unnumbered** This API sets an interface unnumbered. It sets the IFF_POINTOPOINT flags* and creates a routing entry through the interface using a user-specified* destination IP address. The unnumbered link can then be uniquely referred* to by the destination IP address, <pDstIp>, when adding routes. The* interface is assigned a "borrowed" IP address--borrowed from another* interface on the machine. In RFC 1812 it is also called the router ID.* This address will be used to generate any needed ICMP messages or the like.* Note that ARP is not able to run on an unnumbered link.* * The initialization of the unnumbered device is similar to other* network devices, but it does have a few additional steps and concerns.* ifUnnumberedSet() must come next after ipAttach(). Please note that* the interface using the IP address that the unnumbered interface will* borrow must be brought up first and configured with <ifAddrSet> or * equivalent. This is required to ensure normal network operation for* that IP address/interface.  After ifUnnumberedSet(), one must create* additional routing entries (using mRouteAdd(), routeNetAdd(), etc)* in order to reach other networks, including the network to which* the destination IP address belongs. * * The <pDstMac> field in ifUnnumberedSet() is used to specify the* destination's MAC address. It should be left NULL if the destination* is not an Ethernet device. If the MAC address is not known, then* supply an artificial address. We recommend using "00:00:00:00:00:01"* The destination interface can then be set promiscuous to accept* this artificial address. This is accomplished using the <ifpromisc>* command.** Example:* \ss* ipAttach (1, "fei")* ifUnnumberedSet ("fei1", "120.12.12.12", "140.34.78.94", "00:a0:d0:d8:c8:14")* routeNetAdd ("120.12.0.0","120.12.12.12") <One possible network>* routeNetAdd ("178.45.0.0","120.12.12.12") <Another possible network>* \se* RETURNS: OK, or ERROR if the interface cannot be set.**/#ifdef ROUTER_STACKSTATUS ifUnnumberedSet    (    char *pIfName,	/* Name of interface to configure */     char *pDstIp, 	/* Destination address of the point to point link */    char *pBorrowedIp,	/* The borrowed IP address/router ID */    char *pDstMac	/* Destination MAC address */    )    {    int s, ret;    struct ifnet *ifp;    struct sockaddr_in sock;    if(!(ifp = ifunit (pIfName)))	return (ERROR);    /*     * Make sure that the interface with the "real"     * pBorrowedIp is already brought up.     */    bzero ((char *)&sock, sizeof (struct sockaddr_in));    sock.sin_family = AF_INET;    sock.sin_len = sizeof (struct sockaddr_in);    sock.sin_addr.s_addr = inet_addr (pBorrowedIp);    if (!ifa_ifwithaddr ((struct sockaddr *)&sock))        return (EINVAL);     /* We manually configure the interface to be IFF_UNNUMBERED */    s = splnet ();    ifp->if_flags &= ~IFF_BROADCAST;    ifp->if_flags |= IFF_UNNUMBERED;	/* It's defined as IFF_POINTOPOINT */    splx (s);    ret = ifAddrAdd (pIfName, pBorrowedIp, pDstIp, 0);    if (ret != OK)	return (ret);    /*     * For ethernet devices, we need to complete the route entry     * just created by the above operation. The ATF_INCOMPLETE flag     * will change the routing entry to contain the MAC address     * of the destination's ethernet device.     */    if (pDstMac != (char *)NULL)        ret = arpAdd (pDstIp, pDstMac, ATF_PERM | ATF_INCOMPLETE);    return (ret);    }#endif /* ROUTER_STACK *//********************************************************************************* ifAddrAdd - add an interface address for a network interface** This routine assigns an Internet address to a specified network interface.* The Internet address can be a host name or a standard Internet address* format (e.g., 90.0.0.4).  If a host name is specified, it should already* have been added to the host table with hostAdd().** You must specify both an <interfaceName> and an <interfaceAddress>. A * <broadcastAddress> is optional. If <broadcastAddress> is NULL, in_ifinit() * generates a <broadcastAddress> value based on the <interfaceAddress> value* and the netmask.  A <subnetMask> value is optional.  If <subnetMask> is 0, * in_ifinit() uses a <subnetMask> the same as the netmask that is generated * by the <interfaceAddress>.  The <broadcastAddress> is also <destAddress> in * case of IFF_POINTOPOINT.** RETURNS: OK, or ERROR if the interface cannot be set.** SEE ALSO: ifAddrGet(), ifDstAddrSet(), ifDstAddrGet()*/STATUS ifAddrAdd    (    char *interfaceName,     /* name of interface to configure */    char *interfaceAddress,  /* Internet address to assign to interface */    char *broadcastAddress,  /* broadcast address to assign to interface */    int   subnetMask         /* subnetMask */    )    {    struct ifaliasreq   ifa;    struct sockaddr_in *pSin_iaddr = (struct sockaddr_in *)&ifa.ifra_addr;    struct sockaddr_in *pSin_baddr = (struct sockaddr_in *)&ifa.ifra_broadaddr;    struct sockaddr_in *pSin_snmsk = (struct sockaddr_in *)&ifa.ifra_mask;    int                 so;    int                 status = 0;    bzero ((caddr_t) &ifa, sizeof (ifa));    /* verify Internet address is in correct format */    if ((pSin_iaddr->sin_addr.s_addr =             inet_addr (interfaceAddress)) == ERROR &&        (pSin_iaddr->sin_addr.s_addr =             hostGetByName (interfaceAddress) == ERROR))        {        return (ERROR);        }    /* verify Boradcast address is in correct format */    if (broadcastAddress != NULL &&        (pSin_baddr->sin_addr.s_addr =             inet_addr (broadcastAddress)) == ERROR &&        (pSin_baddr->sin_addr.s_addr =             hostGetByName (broadcastAddress) == ERROR))        {        return (ERROR);        }    strncpy (ifa.ifra_name, interfaceName, sizeof (ifa.ifra_name));    /* for interfaceAddress */    ifa.ifra_addr.sa_len = sizeof (struct sockaddr_in);    ifa.ifra_addr.sa_family = AF_INET;    /* for broadcastAddress */    if (broadcastAddress != NULL)        {        ifa.ifra_broadaddr.sa_len = sizeof (struct sockaddr_in);        ifa.ifra_broadaddr.sa_family = AF_INET;        }    /* for subnetmask */    if (subnetMask != 0)       {       ifa.ifra_mask.sa_len = sizeof (struct sockaddr_in);       ifa.ifra_mask.sa_family = AF_INET;       pSin_snmsk->sin_addr.s_addr = htonl (subnetMask);       }    if ((so = socket (AF_INET, SOCK_RAW, 0)) < 0)        return (ERROR);    status = ioctl (so, SIOCAIFADDR, (int)&ifa);    (void)close (so);    if (status != 0)        {        if (status != ERROR)    /* iosIoctl() can return ERROR */            (void)errnoSet (status);        return (ERROR);        }    return (OK);    }/********************************************************************************* ifAddrSet - set an interface address for a network interface** This routine assigns an Internet address to a specified network interface.* The Internet address can be a host name or a standard Internet address* format (e.g., 90.0.0.4).  If a host name is specified, it should already* have been added to the host table with hostAdd().** A successful call to ifAddrSet() results in the addition of a new route.** The subnet mask used in determining the network portion of the address will* be that set by ifMaskSet(), or the default class mask if ifMaskSet() has not* been called.  It is standard practice to call ifMaskSet() prior to calling* ifAddrSet().** RETURNS: OK, or ERROR if the interface cannot be set.** SEE ALSO: ifAddrGet(), ifDstAddrSet(), ifDstAddrGet()*/STATUS ifAddrSet    (    char *interfaceName,        /* name of interface to configure, i.e. ei0 */    char *interfaceAddress      /* Internet address to assign to interface */    )    {    return (ifIoctl (interfaceName, SIOCSIFADDR, (int)interfaceAddress));    }/********************************************************************************* ifAddrDelete - delete an interface address for a network interface** This routine deletes an Internet address from a specified network interface.* The Internet address can be a host name or a standard Internet address* format (e.g., 90.0.0.4).  If a host name is specified, it should already* have been added to the host table with hostAdd().** RETURNS: OK, or ERROR if the interface cannot be deleted.** SEE ALSO: ifAddrGet(), ifDstAddrSet(), ifDstAddrGet()*/STATUS ifAddrDelete    (    char *interfaceName,        /* name of interface to delete addr from */    char *interfaceAddress      /* Internet address to delete from interface */    )    {    return (ifIoctl (interfaceName, SIOCDIFADDR, (int) interfaceAddress));    }/********************************************************************************* ifAddrGet - get the Internet address of a network interface

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品免费在线观看| 国产成人午夜视频| 欧美日韩精品高清| 在线免费观看日韩欧美| 欧美色偷偷大香| 欧美一级艳片视频免费观看| 日韩一级片在线观看| 国产日产欧美一区二区视频| 99久久精品久久久久久清纯| 99国产精品一区| 日韩精品一区二区三区三区免费| 国产欧美精品一区二区三区四区 | 日韩视频在线永久播放| 久久久久久一级片| 亚洲资源中文字幕| 久久99精品久久久久| 欧美影片第一页| 久久久久久久久久久久久夜| 天天射综合影视| 99精品视频在线免费观看| 欧美日韩一区国产| 欧美一区二区三区在线看| 日韩欧美激情在线| 亚洲激情一二三区| 亚洲国产日韩精品| 奇米精品一区二区三区四区| 99麻豆久久久国产精品免费优播| 欧美一区二区精美| 亚洲国产精品嫩草影院| 91丨porny丨国产| 久久精品视频网| 久久er99精品| 欧美videofree性高清杂交| 亚洲午夜久久久| 欧洲精品在线观看| 亚洲成人1区2区| 欧美精品在线观看播放| 亚洲一区二区三区在线| 色av一区二区| 亚洲精品中文字幕在线观看| 成人a区在线观看| www.成人在线| 亚洲精品欧美激情| 91福利在线播放| 午夜欧美大尺度福利影院在线看| 色婷婷久久久亚洲一区二区三区 | 国产精品中文有码| 国产精品一区三区| 国产精品国产三级国产有无不卡| 亚洲综合999| 日韩视频免费观看高清在线视频| 国产精品66部| 一区二区三区在线观看视频| 欧美一级欧美三级| 国产精品一品视频| 91国模大尺度私拍在线视频| 日本aⅴ精品一区二区三区| 久久久久久久久久久久久久久99| 91福利视频久久久久| 国产一区二区三区久久久| 亚洲精品乱码久久久久久黑人| 欧美一区中文字幕| 99精品视频免费在线观看| 久久99国产精品久久99| 1000精品久久久久久久久| 欧美成人一区二区三区在线观看| 99精品国产99久久久久久白柏| 免费观看30秒视频久久| 亚洲一二三区在线观看| 亚洲欧洲日本在线| 久久精品夜色噜噜亚洲a∨| 欧美一级欧美三级在线观看| 欧美日韩午夜在线| 日本丰满少妇一区二区三区| 91婷婷韩国欧美一区二区| 国产成人超碰人人澡人人澡| 国产精品欧美久久久久一区二区| 久久精品国产一区二区三区免费看| 一区二区三区四区av| 伊人夜夜躁av伊人久久| 国产精品卡一卡二| 亚洲欧洲日韩在线| 一级女性全黄久久生活片免费| 亚洲乱码国产乱码精品精小说| 中文字幕一区二区在线观看| 中文字幕 久热精品 视频在线| 中文一区二区在线观看| 中文字幕一区二区三区乱码在线 | 国产一区二区在线免费观看| 亚洲国产wwwccc36天堂| 日本成人超碰在线观看| 亚洲电影第三页| 欧美影院午夜播放| 欧美一区二区三区四区在线观看| 91精品久久久久久久91蜜桃| 精品美女在线播放| 国产精品久久久久天堂| 亚洲一区日韩精品中文字幕| 日韩av电影免费观看高清完整版| 蜜臀av性久久久久av蜜臀妖精| 国产在线视频不卡二| 色婷婷综合激情| 欧美电影免费观看高清完整版| 国产精品高潮久久久久无| 亚洲永久精品大片| 国产日韩亚洲欧美综合| 亚洲国产cao| 成人app在线| www欧美成人18+| 天天综合色天天| 色天天综合色天天久久| wwwwww.欧美系列| 肉肉av福利一精品导航| 色婷婷综合五月| 亚洲国产精华液网站w| 日韩和的一区二区| 在线国产亚洲欧美| 国产精品九色蝌蚪自拍| 成人精品免费看| 欧美国产国产综合| 国产99久久久精品| 国产精品日产欧美久久久久| 极品销魂美女一区二区三区| 欧美一区二区私人影院日本| 日韩激情视频网站| 欧美日韩另类国产亚洲欧美一级| 亚洲自拍另类综合| 欧美男男青年gay1069videost| 亚洲线精品一区二区三区八戒| 91精品1区2区| 亚洲成a人v欧美综合天堂下载| 欧美在线视频全部完| 亚洲精品国产第一综合99久久 | 国产亚洲精品aa午夜观看| 国产精品中文字幕日韩精品| 欧美高清在线一区二区| 成人综合在线视频| 欧美日韩一区三区| 理论片日本一区| 国产精品麻豆久久久| 欧美无乱码久久久免费午夜一区| 天天综合色天天综合色h| 精品国产精品网麻豆系列 | 欧美一区二区三区免费视频| 亚洲国产精品久久艾草纯爱| 欧美xxxxxxxx| 色婷婷激情综合| 国产真实乱对白精彩久久| 亚洲精品国产无套在线观| 精品国产区一区| 欧美日韩一区国产| 91一区二区在线观看| 美女视频网站黄色亚洲| 一区二区视频免费在线观看| 337p日本欧洲亚洲大胆精品| 欧美日韩一本到| av午夜精品一区二区三区| 久久成人18免费观看| 亚洲国产日产av| 一区二区视频在线| 成人网页在线观看| 韩国女主播一区二区三区| 一区二区久久久久久| ...av二区三区久久精品| 久久久亚洲综合| 精品国产一区二区亚洲人成毛片 | 色哟哟欧美精品| 一区二区三区在线视频观看| 中文字幕在线观看一区| 久久免费视频一区| 欧美大黄免费观看| 欧美一二三四区在线| 日韩欧美在线影院| 欧美一区二区视频观看视频| 精品久久久久久久人人人人传媒| 欧美欧美欧美欧美首页| 欧美日韩成人综合| 欧美日高清视频| 欧美区在线观看| 欧美精品一区二区久久婷婷| 久久亚区不卡日本| 亚洲欧洲精品天堂一级 | 欧美日韩国产经典色站一区二区三区 | 久久综合99re88久久爱| 久久精品人人做人人爽人人| 中文字幕中文字幕一区| 一区二区三区毛片| 美女视频第一区二区三区免费观看网站| 日本成人超碰在线观看| 国产69精品久久777的优势| 94-欧美-setu| 欧美一区二区三区性视频| 国产色一区二区| 午夜视黄欧洲亚洲| 18欧美亚洲精品| 国产成人av资源| 成a人片国产精品| 欧美日本在线观看| 欧美国产日韩亚洲一区| 国产精品理论在线观看|