亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美精品日日鲁夜夜添| 亚洲一区二区综合| 亚洲一区在线观看视频| 久国产精品韩国三级视频| 色婷婷香蕉在线一区二区| 欧美一区二区福利在线| 亚洲欧洲制服丝袜| 极品美女销魂一区二区三区| 欧美三级视频在线观看| 国产精品久久久久aaaa樱花| 久久99国产乱子伦精品免费| 欧美视频一区在线| 一二三四社区欧美黄| 成人综合在线视频| 精品999在线播放| 蜜桃视频在线观看一区| 这里只有精品免费| 亚洲成av人片一区二区梦乃| 色噜噜狠狠一区二区三区果冻| 国产网站一区二区| 国产乱人伦偷精品视频不卡 | 日韩午夜三级在线| 亚洲一区在线观看视频| 97成人超碰视| 亚洲欧洲av一区二区三区久久| 国产一区二区三区四| 精品免费视频一区二区| 另类专区欧美蜜桃臀第一页| 日韩午夜中文字幕| 久久精品国产精品亚洲红杏| 91精品免费在线| 亚洲成av人片一区二区梦乃| 欧美日韩一级二级| 亚洲国产日韩在线一区模特 | 高清日韩电视剧大全免费| 久久婷婷综合激情| 国产高清精品网站| 亚洲欧洲国产日本综合| 欧美中文字幕一区二区三区 | 久久国产免费看| 久久久久国产精品麻豆| 国产成人精品免费看| 国产精品国产精品国产专区不蜜| 成人妖精视频yjsp地址| 成人欧美一区二区三区在线播放| 91丨porny丨蝌蚪视频| 亚洲一卡二卡三卡四卡无卡久久 | 欧美精品一区二区不卡| 国产精品性做久久久久久| 国产精品成人免费| 91久久精品一区二区三区| 丝袜美腿亚洲色图| 久久人人97超碰com| 91影院在线免费观看| 五月激情六月综合| 亚洲精品一区二区三区在线观看 | 欧美日韩视频在线第一区| 视频一区视频二区中文字幕| 日韩欧美国产综合在线一区二区三区| 国产在线麻豆精品观看| 最近日韩中文字幕| 欧美一区二区三区成人| 成人激情动漫在线观看| 亚洲午夜久久久久久久久久久| 日韩欧美一级二级| 波多野结衣欧美| 日本视频免费一区| 国产精品欧美一级免费| 91精品在线麻豆| 91在线观看成人| 国内偷窥港台综合视频在线播放| 国产精品色婷婷久久58| 欧美军同video69gay| 成人国产亚洲欧美成人综合网| 亚洲国产精品久久久男人的天堂| 久久精品夜夜夜夜久久| 日本高清无吗v一区| 国产一区二区毛片| 亚洲第一电影网| 国产精品午夜电影| 日韩精品一区二区三区在线播放 | 69久久99精品久久久久婷婷| 国产+成+人+亚洲欧洲自线| 亚洲成av人片| 亚洲欧美国产三级| 日本一区二区视频在线| 91精品国产综合久久蜜臀| 91在线视频观看| 国产成人午夜99999| 日产国产高清一区二区三区 | 中文乱码免费一区二区| 日韩久久久精品| 欧美高清hd18日本| 91在线国产观看| 国产福利一区二区| 国产专区综合网| 美女一区二区久久| 亚洲 欧美综合在线网络| 一区二区三区中文字幕精品精品 | 麻豆成人91精品二区三区| 亚洲一区二区在线观看视频| 国产精品欧美极品| 国产日韩欧美综合一区| 久久久国产午夜精品| 精品欧美黑人一区二区三区| 日韩欧美亚洲另类制服综合在线| 欧美伦理电影网| 91精品国产一区二区| 欧美精品黑人性xxxx| 欧美精品乱码久久久久久按摩| 欧美日韩精品一区二区| 欧美午夜片在线观看| 欧美私人免费视频| 欧美日韩高清一区二区| 欧美日韩在线一区二区| 在线观看国产日韩| 欧美三级蜜桃2在线观看| 欧美群妇大交群中文字幕| 欧美精品色一区二区三区| 欧美三级在线播放| 日韩一区二区在线免费观看| 精品国产一区二区精华| 久久久精品综合| 136国产福利精品导航| 亚洲综合视频在线观看| 午夜av一区二区三区| 免费欧美在线视频| 国产一区二区三区高清播放| eeuss鲁一区二区三区| 日本精品视频一区二区| 欧美日韩情趣电影| 欧美va日韩va| 国产精品久久久久影院色老大| 亚洲激情男女视频| 午夜电影网一区| 国产一区二区不卡| 成人性生交大片免费看在线播放| 99久久久久久99| 91麻豆精品久久久久蜜臀| 久久久久久久网| 樱花草国产18久久久久| 蜜臀av性久久久久av蜜臀妖精 | 日韩精品一区二区三区中文精品| 久久综合色之久久综合| 一区二区三区四区不卡在线| 日本网站在线观看一区二区三区| 国产在线播精品第三| 色综合中文字幕| 日韩美女视频一区二区在线观看| 国产精品久久久久一区| 热久久国产精品| jvid福利写真一区二区三区| 欧美精品一二三四| 欧美高清在线一区| 奇米一区二区三区| 91亚洲永久精品| 久久久久久久精| 亚洲国产精品久久艾草纯爱| 国内成+人亚洲+欧美+综合在线| 日本韩国一区二区三区| 国产午夜三级一区二区三| 婷婷久久综合九色综合绿巨人| 国产·精品毛片| 欧美不卡激情三级在线观看| 亚洲欧美日韩国产成人精品影院 | 日韩高清欧美激情| 成人免费视频一区| 日韩欧美国产一区在线观看| 亚洲免费高清视频在线| 国产成人99久久亚洲综合精品| 欧美精品在线观看播放| 国产精品电影一区二区| 久久精品国产99| 91精品国产aⅴ一区二区| 亚洲乱码国产乱码精品精98午夜 | 狠狠色狠狠色综合日日91app| 欧美亚洲综合在线| 亚洲日本电影在线| 成人国产一区二区三区精品| 久久久久久久精| 蜜臀av性久久久久蜜臀aⅴ四虎| 在线观看亚洲一区| 亚洲日韩欧美一区二区在线| 丁香婷婷综合网| 久久久精品tv| 国产自产视频一区二区三区| 日韩美女一区二区三区四区| 免费欧美高清视频| 欧美精品九九99久久| 日韩精品国产精品| 欧美精品在线视频| 天堂一区二区在线| 在线看一区二区| 亚洲一区二区三区四区五区中文| 色综合久久中文综合久久97| 亚洲乱码国产乱码精品精的特点| 色综合久久中文字幕| 一区二区三区在线视频免费观看| 91在线免费播放| 亚洲一区二区三区爽爽爽爽爽|