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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? auth.c

?? 基于AT91SAM7x256的硬件平臺(tái)的WEB服務(wù)器源碼(A&shy DS版本, ucOS_II+LWIP+自己編寫的DNS查詢工具)
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/****************************************************************************** auth.c - Network Authentication and Phase Control program file.** Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.* Copyright (c) 1997 by Global Election Systems Inc.  All rights reserved.** The authors hereby grant permission to use, copy, modify, distribute,* and license this software and its documentation for any purpose, provided* that existing copyright notices are retained in all copies and that this* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required* for any of the authorized uses.** THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.******************************************************************************** REVISION HISTORY** 03-01-01 Marc Boucher <marc@mbsi.ca>*   Ported to lwIP.* 97-12-08 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.*   Ported from public pppd code.*****************************************************************************//* * auth.c - PPP authentication and phase control. * * Copyright (c) 1993 The Australian National University. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the Australian National University.  The name of the University * may not be used to endorse or promote products derived from this * software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Copyright (c) 1989 Carnegie Mellon University. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by Carnegie Mellon University.  The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */#include "ppp.h"#if PPP_SUPPORT > 0#include "fsm.h"#include "lcp.h"#include "pap.h"#include "chap.h"#include "auth.h"#include "ipcp.h"#if CBCP_SUPPORT > 0#include "cbcp.h"#endif#include "pppdebug.h"/*************************//*** LOCAL DEFINITIONS ***//*************************//* Bits in auth_pending[] */#define PAP_WITHPEER    1#define PAP_PEER    2#define CHAP_WITHPEER   4#define CHAP_PEER   8                                                                    /************************//*** LOCAL DATA TYPES ***//************************//* Used for storing a sequence of words.  Usually malloced. */struct wordlist {    struct wordlist *next;    char        word[1];};/***********************************//*** LOCAL FUNCTION DECLARATIONS ***//***********************************/extern char *crypt (const char *, const char *);/* Prototypes for procedures local to this file. */static void network_phase (int);static void check_idle (void *);static void connect_time_expired (void *);#if 0static int  login (char *, char *, char **, int *);#endifstatic void logout (void);static int  null_login (int);static int  get_pap_passwd (int, char *, char *);static int  have_pap_secret (void);static int  have_chap_secret (char *, char *, u32_t);static int  ip_addr_check (u32_t, struct wordlist *);#if 0 /* PAP_SUPPORT > 0 || CHAP_SUPPORT > 0 */static void set_allowed_addrs(int unit, struct wordlist *addrs);static void free_wordlist (struct wordlist *);#endif#if CBCP_SUPPORT > 0static void callback_phase (int);#endif/******************************//*** PUBLIC DATA STRUCTURES ***//******************************//*****************************//*** LOCAL DATA STRUCTURES ***//*****************************/#if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0/* The name by which the peer authenticated itself to us. */static char peer_authname[MAXNAMELEN];#endif/* Records which authentication operations haven't completed yet. */static int auth_pending[NUM_PPP];/* Set if we have successfully called login() */static int logged_in;/* Set if we have run the /etc/ppp/auth-up script. */static int did_authup;/* List of addresses which the peer may use. */static struct wordlist *addresses[NUM_PPP];/* Number of network protocols which we have opened. */static int num_np_open;/* Number of network protocols which have come up. */static int num_np_up;#if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0/* Set if we got the contents of passwd[] from the pap-secrets file. */static int passwd_from_file;#endif/***********************************//*** PUBLIC FUNCTION DEFINITIONS ***//***********************************//* * An Open on LCP has requested a change from Dead to Establish phase. * Do what's necessary to bring the physical layer up. */void link_required(int unit){    AUTHDEBUG((LOG_INFO, "link_required: %d\n", unit));}/* * LCP has terminated the link; go to the Dead phase and take the * physical layer down. */void link_terminated(int unit){    AUTHDEBUG((LOG_INFO, "link_terminated: %d\n", unit));        if (lcp_phase[unit] == PHASE_DEAD)        return;    if (logged_in)        logout();    lcp_phase[unit] = PHASE_DEAD;    AUTHDEBUG((LOG_NOTICE, "Connection terminated.\n"));	pppMainWakeup(unit);}/* * LCP has gone down; it will either die or try to re-establish. */void link_down(int unit){    int i;    struct protent *protp;        AUTHDEBUG((LOG_INFO, "link_down: %d\n", unit));    if (did_authup) {        /* XXX Do link down processing. */        did_authup = 0;    }    for (i = 0; (protp = ppp_protocols[i]) != NULL; ++i) {        if (!protp->enabled_flag)            continue;        if (protp->protocol != PPP_LCP && protp->lowerdown != NULL)            (*protp->lowerdown)(unit);        if (protp->protocol < 0xC000 && protp->close != NULL)            (*protp->close)(unit, "LCP down");    }    num_np_open = 0;    num_np_up = 0;    if (lcp_phase[unit] != PHASE_DEAD)        lcp_phase[unit] = PHASE_TERMINATE;	pppMainWakeup(unit);}/* * The link is established. * Proceed to the Dead, Authenticate or Network phase as appropriate. */void link_established(int unit){    int auth;    int i;    struct protent *protp;    lcp_options *wo = &lcp_wantoptions[unit];    lcp_options *go = &lcp_gotoptions[unit];#if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0    lcp_options *ho = &lcp_hisoptions[unit];#endif        AUTHDEBUG((LOG_INFO, "link_established: %d\n", unit));    /*     * Tell higher-level protocols that LCP is up.     */    for (i = 0; (protp = ppp_protocols[i]) != NULL; ++i)        if (protp->protocol != PPP_LCP && protp->enabled_flag                && protp->lowerup != NULL)            (*protp->lowerup)(unit);        if (ppp_settings.auth_required && !(go->neg_chap || go->neg_upap)) {        /*         * We wanted the peer to authenticate itself, and it refused:         * treat it as though it authenticated with PAP using a username         * of "" and a password of "".  If that's not OK, boot it out.         */        if (!wo->neg_upap || !null_login(unit)) {            AUTHDEBUG((LOG_WARNING, "peer refused to authenticate\n"));            lcp_close(unit, "peer refused to authenticate");            return;        }    }        lcp_phase[unit] = PHASE_AUTHENTICATE;    auth = 0;#if CHAP_SUPPORT > 0    if (go->neg_chap) {        ChapAuthPeer(unit, ppp_settings.our_name, go->chap_mdtype);        auth |= CHAP_PEER;    } #endif#if PAP_SUPPORT > 0 && CHAP_SUPPORT > 0    else#endif#if PAP_SUPPORT > 0    if (go->neg_upap) {        upap_authpeer(unit);        auth |= PAP_PEER;    }#endif#if CHAP_SUPPORT > 0    if (ho->neg_chap) {        ChapAuthWithPeer(unit, ppp_settings.user, ho->chap_mdtype);        auth |= CHAP_WITHPEER;    }#endif#if PAP_SUPPORT > 0 && CHAP_SUPPORT > 0    else#endif#if PAP_SUPPORT > 0    if (ho->neg_upap) {        if (ppp_settings.passwd[0] == 0) {            passwd_from_file = 1;            if (!get_pap_passwd(unit, ppp_settings.user, ppp_settings.passwd))                AUTHDEBUG((LOG_ERR, "No secret found for PAP login\n"));        }        upap_authwithpeer(unit, ppp_settings.user, ppp_settings.passwd);        auth |= PAP_WITHPEER;    }#endif    auth_pending[unit] = auth;        if (!auth)        network_phase(unit);}/* * The peer has failed to authenticate himself using `protocol'. */void auth_peer_fail(int unit, u16_t protocol){    AUTHDEBUG((LOG_INFO, "auth_peer_fail: %d proto=%X\n", unit, protocol));    /*     * Authentication failure: take the link down     */    lcp_close(unit, "Authentication failed");}#if PAP_SUPPORT > 0 || CHAP_SUPPORT > 0/* * The peer has been successfully authenticated using `protocol'. */void auth_peer_success(int unit, u16_t protocol, char *name, int namelen){    int pbit;        AUTHDEBUG((LOG_INFO, "auth_peer_success: %d proto=%X\n", unit, protocol));    switch (protocol) {    case PPP_CHAP:        pbit = CHAP_PEER;        break;    case PPP_PAP:        pbit = PAP_PEER;        break;    default:        AUTHDEBUG((LOG_WARNING, "auth_peer_success: unknown protocol %x\n",               protocol));        return;    }        /*     * Save the authenticated name of the peer for later.     */    if (namelen > sizeof(peer_authname) - 1)        namelen = sizeof(peer_authname) - 1;    BCOPY(name, peer_authname, namelen);    peer_authname[namelen] = 0;        /*     * If there is no more authentication still to be done,     * proceed to the network (or callback) phase.     */    if ((auth_pending[unit] &= ~pbit) == 0)        network_phase(unit);}/* * We have failed to authenticate ourselves to the peer using `protocol'. */void auth_withpeer_fail(int unit, u16_t protocol){    int errCode = PPPERR_AUTHFAIL;        AUTHDEBUG((LOG_INFO, "auth_withpeer_fail: %d proto=%X\n", unit, protocol));    if (passwd_from_file)        BZERO(ppp_settings.passwd, MAXSECRETLEN);    /*      * XXX Warning: the unit number indicates the interface which is     * not necessarily the PPP connection.  It works here as long     * as we are only supporting PPP interfaces.     */    pppIOCtl(unit, PPPCTLS_ERRCODE, &errCode);    /*     * We've failed to authenticate ourselves to our peer.     * He'll probably take the link down, and there's not much     * we can do except wait for that.     */}/* * We have successfully authenticated ourselves with the peer using `protocol'. */void auth_withpeer_success(int unit, u16_t protocol){    int pbit;        AUTHDEBUG((LOG_INFO, "auth_withpeer_success: %d proto=%X\n", unit, protocol));    switch (protocol) {    case PPP_CHAP:        pbit = CHAP_WITHPEER;        break;    case PPP_PAP:        if (passwd_from_file)            BZERO(ppp_settings.passwd, MAXSECRETLEN);        pbit = PAP_WITHPEER;        break;    default:        AUTHDEBUG((LOG_WARNING, "auth_peer_success: unknown protocol %x\n",               protocol));        pbit = 0;    }        /*     * If there is no more authentication still being done,     * proceed to the network (or callback) phase.     */    if ((auth_pending[unit] &= ~pbit) == 0)        network_phase(unit);}#endif/* * np_up - a network protocol has come up. */void np_up(int unit, u16_t proto){    AUTHDEBUG((LOG_INFO, "np_up: %d proto=%X\n", unit, proto));    if (num_np_up == 0) {	AUTHDEBUG((LOG_INFO, "np_up: maxconnect=%d idle_time_limit=%d\n",ppp_settings.maxconnect,ppp_settings.idle_time_limit));        /*         * At this point we consider that the link has come up successfully.         */        if (ppp_settings.idle_time_limit > 0)            TIMEOUT(check_idle, NULL, ppp_settings.idle_time_limit);                /*         * Set a timeout to close the connection once the maximum         * connect time has expired.         */        if (ppp_settings.maxconnect > 0)            TIMEOUT(connect_time_expired, 0, ppp_settings.maxconnect);    }    ++num_np_up;}/* * np_down - a network protocol has gone down. */void np_down(int unit, u16_t proto){    AUTHDEBUG((LOG_INFO, "np_down: %d proto=%X\n", unit, proto));    if (--num_np_up == 0 && ppp_settings.idle_time_limit > 0) {        UNTIMEOUT(check_idle, NULL);    }}/* * np_finished - a network protocol has finished using the link. */void np_finished(int unit, u16_t proto){    AUTHDEBUG((LOG_INFO, "np_finished: %d proto=%X\n", unit, proto));    if (--num_np_open <= 0) {        /* no further use for the link: shut up shop. */        lcp_close(0, "No network protocols running");    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情图区综合网| 欧美日韩另类国产亚洲欧美一级| 国产suv精品一区二区三区| 国产在线观看免费一区| 国产91丝袜在线观看| 99久久精品免费看| 91精品国产91久久综合桃花 | 精品嫩草影院久久| 国产欧美日韩在线看| 亚洲伊人色欲综合网| 激情综合色播激情啊| 99精品欧美一区二区三区小说| 欧美日韩日本视频| 久久久亚洲午夜电影| 亚洲h动漫在线| 粉嫩蜜臀av国产精品网站| 欧美日韩国产免费| 国产精品1024久久| 日韩欧美电影在线| 亚洲自拍偷拍综合| 不卡在线视频中文字幕| 亚洲美女视频在线观看| 亚洲精品国产a久久久久久| 国产在线精品一区二区夜色| 欧美视频一区二| 亚洲欧美怡红院| 国产91富婆露脸刺激对白 | 精品蜜桃在线看| 一个色妞综合视频在线观看| 成人三级在线视频| 2020国产精品久久精品美国| 奇米影视一区二区三区小说| 欧美怡红院视频| 亚洲黄色小视频| 色婷婷久久综合| 一区二区三区四区视频精品免费 | 国产中文字幕一区| 国产欧美一区二区三区沐欲| 加勒比av一区二区| 欧美mv日韩mv亚洲| 久久国产精品第一页| 日韩精品一区二区三区中文精品| 日产国产欧美视频一区精品| 欧美一区二区三区视频| 国产呦萝稀缺另类资源| 久久这里只有精品首页| 国产91在线观看| 亚洲丝袜美腿综合| 欧美日韩在线播放| 另类人妖一区二区av| 欧美国产一区二区在线观看| 97成人超碰视| 青青草精品视频| 国产亚洲成av人在线观看导航| www.欧美日韩| 丝袜美腿成人在线| 久久综合九色综合97婷婷| 成人av在线播放网站| 午夜久久久久久电影| 国产日本欧洲亚洲| 欧美撒尿777hd撒尿| 国产精品影视网| 午夜成人免费视频| 国产精品久久看| 欧美一区二区美女| 成人av电影在线网| 免费成人你懂的| 国产成人午夜片在线观看高清观看| 国产精品美女久久久久aⅴ| 555夜色666亚洲国产免| 白白色亚洲国产精品| 免费观看91视频大全| 亚洲综合小说图片| 中文字幕中文字幕中文字幕亚洲无线| 欧美一区二区免费| 久久精品国产久精国产| 久久新电视剧免费观看| 91精品福利在线一区二区三区| 5月丁香婷婷综合| 精品美女一区二区| 欧美日韩精品久久久| 成人精品一区二区三区中文字幕| 日韩成人伦理电影在线观看| 亚洲综合男人的天堂| 日韩一区二区三区免费看| 精品国产免费人成电影在线观看四季| 97精品视频在线观看自产线路二| 久久国产夜色精品鲁鲁99| 亚洲一区二区三区中文字幕| 免费观看成人av| 亚洲1区2区3区4区| 调教+趴+乳夹+国产+精品| 午夜精品aaa| 国产一区视频导航| 国产激情精品久久久第一区二区 | 日韩av高清在线观看| 午夜精品福利在线| 蜜臀av性久久久久蜜臀aⅴ四虎 | 成人精品电影在线观看| aaa亚洲精品| 56国语精品自产拍在线观看| 日韩欧美成人午夜| 日韩一区二区三区av| 国产精一区二区三区| 日韩福利电影在线观看| 国产精品一区二区三区乱码| 欧美日韩成人综合| 一区二区三区在线影院| 韩国精品主播一区二区在线观看 | 毛片av一区二区三区| 成人美女在线观看| 91精品国产综合久久福利| 精品久久久三级丝袜| 亚洲四区在线观看| 久久精品国产一区二区| www.亚洲国产| 欧美成人女星排名| 一区二区成人在线| 99国产精品一区| 久久久一区二区三区捆绑**| 国产精品美女久久久久av爽李琼| 婷婷开心久久网| 91在线免费看| 中文字幕不卡在线播放| 久久99久久久久久久久久久| 91成人免费在线视频| 久久久一区二区三区| 丝袜诱惑亚洲看片| 色综合久久中文字幕| 精品少妇一区二区三区免费观看| 亚洲人123区| 成人黄色在线看| 欧美电影免费观看高清完整版在| 一区二区激情视频| 色综合久久天天| 中文字幕av不卡| 国产999精品久久久久久| 国产日韩欧美a| 国产不卡视频一区| 中文一区二区在线观看| 99re这里只有精品6| 综合色天天鬼久久鬼色| 欧美在线高清视频| 图片区小说区区亚洲影院| 精品国免费一区二区三区| 国产在线国偷精品免费看| 精品少妇一区二区三区日产乱码 | 亚洲在线一区二区三区| av爱爱亚洲一区| 中文字幕中文字幕在线一区| 99久久精品国产毛片| 亚洲激情校园春色| 欧美视频在线观看一区二区| 性做久久久久久免费观看| 91丝袜国产在线播放| 日韩一区在线播放| 欧美日韩高清一区二区不卡| 日韩高清一区二区| 2020国产精品| 99久久免费精品高清特色大片| 综合av第一页| 91成人免费在线| 久久精品噜噜噜成人88aⅴ| 久久久久久久免费视频了| 成人黄色av网站在线| 尤物av一区二区| 日韩精品中文字幕在线一区| 成人免费精品视频| 日韩精品亚洲一区| 国产亚洲欧美一级| 欧美日韩综合在线| 国产成人免费视| 免费欧美在线视频| 一区二区三区在线观看视频| 欧美白人最猛性xxxxx69交| 91亚洲精品久久久蜜桃| 国产在线播精品第三| 亚洲一区二区三区在线看 | 亚洲日本丝袜连裤袜办公室| 日韩欧美国产综合在线一区二区三区 | 日本女优在线视频一区二区| 国产精品乱人伦中文| 日韩免费观看高清完整版| 欧美中文字幕一区二区三区| 国产精品一区二区视频| 天天av天天翘天天综合网| 亚洲美女视频一区| 久久看人人爽人人| 欧美一区二区三区公司| 欧美午夜片在线看| 91黄色免费看| 99视频热这里只有精品免费| 国产自产高清不卡| 蜜桃在线一区二区三区| 丝袜国产日韩另类美女| 亚洲免费观看在线观看| 国产精品久久久久久久久免费相片 | 欧美日韩国产123区| 欧美日韩免费一区二区三区视频| 日本精品一区二区三区四区的功能|