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

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

?? usrfwhomegwrules.c

?? firewall PNE 3.3 source code, running at more than vxworks6.x version.
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* usrFwHomegwRules.c  - Sample firewall rules for Home/SOHO Gateway *//* Copyright 2004-2005 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01l,28sep05,zhu  Added rate limit with host tracking and HTTP content filter                 Removed rule for website blocking by keyword01k,17jun05,svk  Fix compilation warnings01j,27may05,svk  Replace fwStringSearch() with fastStrSearch()01i,26apr05,zhu  Removed deprecated header files01i,05apr05,myz  added fwExtIpOptsCheck01h,29mar05,svk  Replace usage of Tornado with Workbench01g,06apr04,svk  Send TCP RST for unsolicited SYN-ACK packets01f,01apr04,svk  Add rules for basic DoS protection01e,19mar04,svk  add MAC address filtering01d,18mar04,svk  reorganize, add rules to allow inbound services01c,17mar04,svk  add rules for spoofing protection01b,15mar04,svk  add rule for website blocking by keyword01a,06mar04,svk  created*//* DESCRIPTIONThis file supplies sample firewall rules for a Home/SOHO Gateway. The filtering policy is described below:- All hosts on private network are trusted; all hosts on public network  are untrusted.- All services are available on hosts in the public network. - Only specifically configured services (FTP, HTTP, TELNET, SMTP, POP3)  can be offered by hosts in the private network. Other than these   services, hosts on the public network can not initiate new connections   to the hosts on the private network.- No services are available on the Gateway. That means hosts on the public  network can not initiate new connections to the Gateway.- Allow FTP clients in Normal (Active) mode on the private network to   talk to FTP servers on the public network.  - Block anonymous pings from the public network.- Allow only specified list of private host MAC Addresses to access   the Gateway.- In addition, protect the Gateway and private network from some   Denial of Service (DoS) attacks from the untrusted public network by:  1. Rejecting packets with spoofed source IP addresses (protects     against LAND attack, and others that use reserved/private source      IP addresses).  2. Rejecting IP Directed Broadcast packets (protects against Smurf      and Fraggle type flooding attacks).  3. Rejecting packets with illegal TCP flag combinations (protects     against Xmas scan, NULL scan, and similar types of port scanning).  4. Rejecting or Reassembling fragmented packets (protects against     fragmentation based attacks such as Ping of death, Jolt, sPing,     Teardrop, Newtear, Bonk, Boink, etc.).ASSUMPTION:It is assumed that the Firewall has been already been initialized and configured to:- Initialize the logging facility.- Enable logging for IP Filter.- Initialize the Stateful inspection.- Install RX MAC Filter on the Gateway private interface.- Enable logging for MAC Filter.You can use the Workbench Kernel Editor to initialize and configure the Firewall. Alternately, for a sample Firewall initialization and configuration code, refer to:  target/src/wrn/firewall/sample/usrFwStartup.c*//* includes */#include <vxWorks.h>#include <netconf.h>#include <stdio.h>#include <string.h>#include <strSearchLib.h>#include "wrn/firewall/fwLib.h"#include "netinet/ip.h"#include "netinet/tcp.h"#include "netinet/ip_icmp.h"/* defines */#define MACADDR_LEN      6  /* number of bytes in MAC address */#define MACADDRSTR_MAX  17  /* max length of MAC address string */#define FRAG_ACCEPT      0  /* allow fragments from public network */#define FRAG_REJECT      1  /* reject fragments from public network */#define FRAG_REASSEMBLE  2  /* reassemble fragments from public network */#define TCP_FLAGS_ALL    (TH_FIN | TH_SYN | TH_RST | TH_PUSH | \                          TH_ACK | TH_URG)  /* all TCP flags */                          #define FTPS_PORT       21  /* FTP service port */#define HTTPS_PORT      80  /* HTTP service port */#define TELNETS_PORT    23  /* TELNET service port */#define SMTPS_PORT      25  /* SMTP service port */#define POPS_PORT      110  /* POP3 service port */#define OPT_LEN_MAX     40  /* maximum IP option length */#define OPT_TYPE_INX     0  /* index to IP option type */#define OPT_LEN_INX      1  /* index to IP option length */#define INVALID_PACKET_ACTION  (FW_REJECT)  /* action on invalid packets */ /* locals *//****************** Configuration Section Start ***************************//* * This is the only part of this file you need to edit to configure the * firewall rules for your environment. *//* Network interfaces */LOCAL char * publicIfName  = "motfcc";  /* public interface name */LOCAL int    publicIfUnit  = 1;         /* public interface unit number */LOCAL char * privateIfName = "motscc";  /* private interface name */LOCAL int    privateIfUnit = 0;         /* private interface unit number */LOCAL char * loIfName      = "lo";      /* loopback interface name */LOCAL int    loIfUnit      = 0;         /* loopback interface unit number *//* Gateway IP address */LOCAL char * publicGwAddr   = "147.11.1.254"; /* gateway public IP address *//* Public network Broadcast address */LOCAL char * publicBcastAddr = "147.11.1.255"; /* public net broadcast addr *//* IP address range of private network */LOCAL char * privateStartAddr = "192.124.127.1";   /* private net start addr */LOCAL char * privateEndAddr   = "192.124.127.254"; /* private net end addr   *//* Block Spoofed packets from public network */LOCAL BOOL spoofingBlock = TRUE;   /* block packets with spoofed source IP */                                   /* addresses from public network        *//* Block IP Directed Broadcast from public network */                                    LOCAL BOOL directedBcastBlock = TRUE; /* block directed broadcast packets */                                       /* from public network              *//* How to handle fragmented packets from public network */LOCAL BOOL fragmentsAction = FRAG_REJECT; /* reject/reassemble/accept      */                                          /* fragments from public network *//* Block packets with illegal TCP flags from public network */LOCAL BOOL badTcpFlagsBlock = TRUE;  /* block packets with illegal TCP */                                     /* flag combinations              *//* Block source routed packets from public network */LOCAL BOOL sourceRouteBlock = TRUE; /* block source routed packets from */		                    /* public network *//* HTTP Content filter */LOCAL BOOL httpContentFilter = FALSE; /* set to TRUE to enable HTTP */                                      /* content filtering          */LOCAL BOOL urlBlock = FALSE; /* set to TRUE to block HTTP URLs based on */                             /* the two lists below */                              /* List of specific URLs to be blocked */LOCAL char * urlBlockList[] =    {    "www.badwebsite.com",    "www.somewebsite.com/badpage",    NULL    /* last entry _must_ be NULL */    };    /* List of keywords in URLs to be blocked */LOCAL char * keywordsInUrlBlockList[] =    {    "bad",    "sleaz",    NULL    /* last entry _must_ be NULL */    };                               /* Block access to Web Proxy Servers in public network */LOCAL BOOL proxyBlock = FALSE; /* block hosts in private network from        */			       /* accessing proxy servers in public network. */			       /* Prevents users in private network from     */			       /* circumventing Firewall's content filtering *//* Block Java Applets */LOCAL BOOL javaAppletBlock = FALSE; /* block access to pubic web sites */				    /* containing Java Applets         *//* Block Active X Controls */LOCAL BOOL activeXBlock = FALSE; /* block access to public web sites */				 /* containing Active X controls     *//* Block Cookies */LOCAL BOOL cookieBlock = FALSE; /* block cookies from being sent to public */				/* web servers                             *//* * Services offered from private network for hosts in public network * * NOTE! For security reasons, typically this is used only with NAT so * that externally the services appear to be available from the Gateway. */LOCAL BOOL inFtpsAllow    = FALSE; /* allow FTP service inside private net */LOCAL BOOL inHttpsAllow   = FALSE; /* allow HTTP service inside private net */LOCAL BOOL inTelnetsAllow = FALSE; /* allow Telnet service inside private net */LOCAL BOOL inSmtpsAllow   = FALSE; /* allow SMTP service inside private net */LOCAL BOOL inPopsAllow    = FALSE; /* allow POP service inside private net *//* Private host offering the above services */LOCAL char * privateServerAddr = NULL; /* private host offering services *//* * MAC Address Filter */ LOCAL BOOL listedMacsAllow = FALSE; /* allow only MAC Addresses listed below */                                    /* to access Gateway private interface   */                                   /* List of private host MAC Addresses allowed to access the Gateway */LOCAL char * macsAllow[] =    {    "00:01:02:03:04:05",    "0a:0b:0c:d0:e0:f0",    NULL    /* last entry _must_ be NULL */    };/* DoS Flood Protection */LOCAL BOOL synFloodProtect = TRUE; /* enable TCP SYN flood protection */LOCAL UINT32 synFloodRate = 200; /* packets/sec - drop SYN packets arriving */                                 /* from public network faster than this rate*/LOCAL BOOL udpFloodProtect = TRUE; /* enable UDP flood protection */LOCAL UINT32 udpFloodRate = 200;  /* packets/sec - drop UDP packets arriving  */                                  /* from public network faster than this rate*/LOCAL BOOL pingFloodProtect = TRUE; /* enable PING flood protection */LOCAL UINT32 pingFloodRate = 200; /* packets/sec - drop Ping packets arriving */                                  /* from public network faster than this rate*//* Logging */LOCAL UINT32 pktLogLen = 40; /* number of bytes in packet to log *//****************** Configuration Section End ****************************//* forward declarations */LOCAL STATUS listedMacsAllowRulesSet();LOCAL STATUS protectionRulesSet();LOCAL STATUS spoofingRulesSet();LOCAL STATUS directedBcastRulesSet();LOCAL STATUS fragmentsRulesSet();LOCAL STATUS badTcpFlagsRulesSet();LOCAL STATUS forwardRulesSet();LOCAL STATUS inGatewayRulesSet();LOCAL STATUS outRulesSet();LOCAL STATUS inFtpsAllowRulesSet();LOCAL STATUS inHttpsAllowRulesSet();LOCAL STATUS inTelnetsAllowRulesSet();LOCAL STATUS inSmtpsAllowRulesSet();LOCAL STATUS inPopsAllowRulesSet();    LOCAL STATUS sourceRouteBlockRulesSet();LOCAL UINT32 sourceRouteBlocker (FW_LOC_TYPE, void *, struct mbuf *, void *);LOCAL STATUS contentFilterRulesSet(void *); LOCAL STATUS floodProtectRulesSet();    /***************************************************************************** usrFwHomegwRules - Set firewall rules for Home Gateway** RETURNS: OK (success), or ERROR (failure)*/STATUS usrFwHomegwRules()    {        /* Sanity check */    if ((privateIfName == NULL) || (publicIfName == NULL))        {        printf("Must specify private and public interface to continue!\n");        return ERROR;        }    /*     * Rules to allow only listed private host MAC Addresses to access      * the Gateway      */        if (listedMacsAllow == TRUE)        {        if (listedMacsAllowRulesSet() == ERROR)            return ERROR;        }    /*     * Rules to protect both gateway and private network from      * bad/invalid IP packets incoming from public network     */    if ((spoofingBlock == TRUE) || (directedBcastBlock == TRUE) ||        (fragmentsAction != FRAG_ACCEPT) || (badTcpFlagsBlock == TRUE))        {             if (protectionRulesSet() == ERROR)                return ERROR;        }    /*     * Rules for forwarded IP packets     * i.e., Public network <---> Private network     */             if (forwardRulesSet() == ERROR)        return ERROR;    /*     * Rules for incoming IP packets to gateway itself     * i.e., Public/Private network ---> Gateway     */            if (inGatewayRulesSet() == ERROR)        return ERROR;            /*     * Rules for all outgoing IP packets     */         if (outRulesSet() == ERROR)        return ERROR;                     return OK;    }/***************************************************************************** listedMacsAllowRulesSet - Set firewall rules to allow only listed private* host MAC Addresses access the Gateway** RETURNS: OK (success), or ERROR (failure)*/LOCAL STATUS listedMacsAllowRulesSet()    {    char ** pMacsAllow;    char macBuf[MACADDRSTR_MAX + 1];    char * token;    UINT8 mac[MACADDR_LEN];    int i;    /*     * Set the default action of the MAC RX Filter to reject. Only     * listed MAC addresses are allowed.     */        if (fwMacFilterDefaultSet(FW_MAC_FILTER_RX, FW_REJECT | FW_LOG,                              NULL, NULL) == ERROR)        {        printf("MAC: Failed to set default action\n");        return ERROR;        }         /* Add each listed MAC Address to the MAC Filter cache */            for (pMacsAllow = macsAllow; *pMacsAllow != NULL; pMacsAllow++)        {        /* Convert the MAC Address from string to binary format */                 if (strlen(*pMacsAllow) > MACADDRSTR_MAX)            {            printf("MAC: Invalid MAC Address string %s\n", *pMacsAllow);            return ERROR;            }                    strcpy(macBuf, *pMacsAllow);        for (token = strtok(macBuf, ":"), i = 0;              (token != NULL) && (i < MACADDR_LEN);              token = strtok(NULL, ":"), i++)            {            mac[i] = (UINT8) strtol(token, (char **)NULL, 16);            }        if (i != MACADDR_LEN)            {            printf("MAC: Invalid MAC Address string %s\n", macBuf);            return ERROR;                        }                    /* Add the MAC Address to the cache */                if (fwMacCacheAdd(FW_MAC_FILTER_RX, mac, TRUE) == ERROR)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲综合在线| 国产一区二区三区在线观看免费| 国产精品大尺度| 久久综合国产精品| 久久中文字幕电影| 久久精品一级爱片| 国产欧美一区二区精品性色 | 欧美三级三级三级| 色屁屁一区二区| 在线观看国产91| 在线观看日韩国产| 欧美美女一区二区三区| 在线不卡免费欧美| 日韩精品中文字幕一区| 精品国产一区二区三区久久久蜜月 | 亚洲精品在线观| 国产日韩欧美在线一区| 中文无字幕一区二区三区| 中文成人综合网| 亚洲欧美成aⅴ人在线观看| 一区二区三区四区高清精品免费观看| 一区二区三区加勒比av| 午夜免费久久看| 久久99精品网久久| 风流少妇一区二区| 日本高清不卡一区| 这里只有精品免费| 久久色在线观看| 亚洲天堂a在线| 日本伊人精品一区二区三区观看方式| 美国欧美日韩国产在线播放| 成人午夜激情片| 欧洲av一区二区嗯嗯嗯啊| 欧美一区二区视频网站| 久久久蜜臀国产一区二区| 日韩一区有码在线| 日韩中文字幕1| 国产91丝袜在线播放0| 在线观看一区二区视频| 日韩欧美中文一区| 国产精品久久毛片| 日韩av一区二区三区四区| 国产成人高清在线| 欧美午夜精品一区二区三区| 欧美电影免费观看高清完整版在 | 久久国产剧场电影| 成人av网站免费| 制服丝袜在线91| 国产精品你懂的| 日本视频在线一区| jizzjizzjizz欧美| 欧美一区二区三区视频在线观看| 欧美韩国一区二区| 日韩不卡一区二区| 99re66热这里只有精品3直播 | 综合激情成人伊人| 奇米影视在线99精品| av一区二区三区四区| 日韩欧美成人午夜| 亚洲一区二区三区中文字幕在线| 狠狠色丁香婷婷综合| 欧美视频一区在线观看| 欧美经典一区二区三区| 日韩av网站免费在线| 97se亚洲国产综合自在线| 亚洲精品一区二区三区蜜桃下载| 一区二区三区日韩在线观看| 国产精品77777竹菊影视小说| 欧美日本精品一区二区三区| 国产精品免费视频一区| 久久精品噜噜噜成人88aⅴ| 在线视频中文字幕一区二区| 欧美激情一区在线观看| 麻豆久久一区二区| 欧美日韩在线免费视频| 国产欧美日韩视频一区二区| 麻豆freexxxx性91精品| 欧美视频精品在线观看| 亚洲乱码国产乱码精品精可以看 | 国产福利精品导航| 欧美va亚洲va香蕉在线| 天天色图综合网| 欧洲一区二区av| 日韩毛片一二三区| 成人免费视频网站在线观看| 国产日韩欧美一区二区三区综合| 久久99在线观看| 91精品国产乱| 天堂av在线一区| 欧美三区在线视频| 亚洲一区二区三区激情| 色先锋久久av资源部| 18成人在线观看| 不卡的av在线播放| 国产精品美女一区二区三区 | 粉嫩av一区二区三区在线播放 | 欧美精品一区二区在线播放| 蜜臀av一区二区在线免费观看| 欧美日韩亚洲高清一区二区| 亚洲精品中文在线观看| 99re66热这里只有精品3直播| 中文字幕一区二区三区乱码在线| 成人午夜精品在线| 亚洲欧洲日韩一区二区三区| 99久久99精品久久久久久 | 国产在线国偷精品免费看| 欧美大片一区二区三区| 久久99久久久欧美国产| 精品黑人一区二区三区久久| 激情综合色综合久久综合| 精品国产一区二区亚洲人成毛片 | av网站一区二区三区| 中文字幕在线不卡一区| 91一区一区三区| 夜色激情一区二区| 欧美日韩免费在线视频| 日韩高清不卡一区| 欧美videofree性高清杂交| 国产在线播放一区三区四| 国产欧美一区二区精品秋霞影院| 丰满白嫩尤物一区二区| 亚洲精品高清视频在线观看| 欧美日韩精品专区| 免费看欧美美女黄的网站| 久久老女人爱爱| heyzo一本久久综合| 亚洲最新在线观看| 69堂精品视频| 国产剧情一区二区三区| 亚洲精品乱码久久久久久久久| 欧美日韩在线播放三区四区| 日韩福利电影在线| 26uuu成人网一区二区三区| 99久久精品99国产精品| 天堂久久一区二区三区| 欧美va亚洲va香蕉在线| 99久久免费视频.com| 亚洲成人一区在线| 精品国产网站在线观看| 色哟哟亚洲精品| 蜜臀a∨国产成人精品| 国产精品色哟哟网站| 欧美日韩卡一卡二| 国产精品91xxx| 亚洲自拍都市欧美小说| 337p日本欧洲亚洲大胆色噜噜| www.视频一区| 蜜桃精品视频在线| 中文字幕在线视频一区| 日韩一级免费观看| 99国产精品国产精品毛片| 蜜臀av一区二区三区| 亚洲激情网站免费观看| 精品人伦一区二区色婷婷| 91美女片黄在线| 国产在线国偷精品免费看| 亚洲一级二级在线| 欧美国产97人人爽人人喊| 欧美一卡二卡在线观看| 91免费小视频| 黑人巨大精品欧美一区| 一级日本不卡的影视| 久久你懂得1024| 欧美日韩高清一区二区不卡 | 日韩精品中文字幕在线不卡尤物| 91在线你懂得| 国产伦精品一区二区三区在线观看| 亚洲免费观看在线观看| 久久新电视剧免费观看| 欧美日韩在线三区| 色综合天天视频在线观看| 国产在线精品一区二区三区不卡| 性感美女久久精品| 亚洲欧洲av色图| 久久久不卡影院| 日韩精品一区二区三区在线播放 | 欧美xxxxxxxx| 欧美日韩精品电影| 91女厕偷拍女厕偷拍高清| 国产91丝袜在线18| 精彩视频一区二区| 日韩国产精品久久久| 亚洲国产裸拍裸体视频在线观看乱了 | 91碰在线视频| www.久久精品| 国产精品18久久久久久久久久久久| 日韩在线一二三区| 亚洲一二三级电影| 亚洲另类春色国产| 国产精品久久久久久久久免费桃花| 精品国产乱码久久| 日韩三级av在线播放| 91精品国产入口| 678五月天丁香亚洲综合网| 欧美在线不卡视频| 欧美伊人精品成人久久综合97| 91丝袜国产在线播放| 成人av午夜影院| 丰满白嫩尤物一区二区| 国产激情视频一区二区三区欧美|