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

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

?? auth.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** 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");    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re热视频这里只精品| 奇米影视一区二区三区小说| 成人永久看片免费视频天堂| 欧美韩国日本不卡| 粉嫩av亚洲一区二区图片| 中文一区在线播放| 色婷婷亚洲综合| 婷婷国产在线综合| www激情久久| 不卡视频一二三| 亚洲成av人片在线| 欧美电影免费观看高清完整版在线观看 | 日本韩国精品一区二区在线观看| 久久久久久久久久电影| 不卡在线视频中文字幕| 亚洲一区在线观看免费观看电影高清| 欧美色区777第一页| 久久69国产一区二区蜜臀| 国产精品色噜噜| 欧美日韩一区二区在线观看 | 精品国内二区三区| 国产一区欧美二区| 亚洲欧美日韩一区| 日韩一区二区三区在线视频| 高清久久久久久| 午夜欧美视频在线观看| 久久免费电影网| 欧美亚洲动漫另类| 国产一区二区三区最好精华液| 国产精品拍天天在线| 欧美日韩一区在线观看| 国产精品乡下勾搭老头1| 亚洲愉拍自拍另类高清精品| 欧美一区二区美女| 91一区二区在线| 全国精品久久少妇| 亚洲激情欧美激情| 国产欧美精品一区aⅴ影院| 欧美体内she精视频| 成人精品亚洲人成在线| 日韩成人一区二区三区在线观看| 国产精品国产三级国产aⅴ原创| 欧美精品v日韩精品v韩国精品v| 成人国产精品免费观看| 麻豆成人av在线| 午夜日韩在线电影| 亚洲天堂网中文字| 日韩精品一区二区三区在线| 91丨porny丨首页| 国产999精品久久久久久绿帽| 日韩专区欧美专区| 亚洲一区电影777| 国产精品免费视频一区| 精品国产乱子伦一区| 欧美色综合天天久久综合精品| 国产精品88888| 久久国产尿小便嘘嘘尿| 亚洲第一成人在线| 亚洲精品久久久久久国产精华液| 国产亚洲欧美激情| 久久久久久久久久久99999| 欧美一区二区三区视频免费播放| 91福利精品视频| 色哦色哦哦色天天综合| 成人网在线免费视频| 国产精品一区二区久激情瑜伽| 日本视频免费一区| 免费人成网站在线观看欧美高清| 午夜精品一区二区三区电影天堂 | 久久久久99精品国产片| 69精品人人人人| 欧美久久久久久久久久| 欧美色大人视频| 欧美日韩国产a| 欧美日韩亚洲另类| 欧美日韩免费高清一区色橹橹| 91精彩视频在线观看| av一区二区三区黑人| 91在线观看视频| 成人一级片网址| 波多野洁衣一区| 91丨porny丨户外露出| k8久久久一区二区三区| 成人av电影观看| 一本久久综合亚洲鲁鲁五月天| 99精品黄色片免费大全| 在线一区二区视频| 欧美精品粉嫩高潮一区二区| 91精品国产欧美一区二区| 日韩一区二区三区视频在线 | 欧美男生操女生| 日韩一区二区精品在线观看| 日韩免费电影一区| 国产日韩一级二级三级| 亚洲欧美日韩在线不卡| 亚洲成av人片在线观看无码| 免费精品视频最新在线| 精品一区二区三区免费播放| 国产黑丝在线一区二区三区| av中文字幕亚洲| 欧美人与性动xxxx| 精品国产一区二区三区忘忧草| 久久久精品日韩欧美| 中文字幕综合网| 亚洲午夜视频在线观看| 精品亚洲免费视频| 9人人澡人人爽人人精品| 欧美三级日韩三级| 日韩精品一区二区三区蜜臀| 国产精品嫩草99a| 日精品一区二区| 粉嫩一区二区三区性色av| 欧美亚男人的天堂| 精品国产一区二区三区av性色| 亚洲国产精品高清| 亚洲va韩国va欧美va| 国产91高潮流白浆在线麻豆| 在线这里只有精品| 久久久久亚洲蜜桃| 亚洲在线中文字幕| 国产成人自拍网| 欧美精品一级二级三级| 国产婷婷色一区二区三区四区| 一区二区高清在线| 国产成人精品免费视频网站| 欧美裸体bbwbbwbbw| 国产色一区二区| 日韩精品国产欧美| 色综合久久综合中文综合网| 精品奇米国产一区二区三区| 亚洲码国产岛国毛片在线| 狠狠色综合日日| 欧美日本在线看| 亚洲精品国产成人久久av盗摄| 精品一区二区在线播放| 欧美三级日韩三级| 亚洲人快播电影网| 国产成人在线免费| 精品久久久久久久一区二区蜜臀| 亚洲美女在线国产| 成人开心网精品视频| 欧美mv和日韩mv的网站| 亚洲一区二区四区蜜桃| 91色在线porny| 欧美国产国产综合| 国产一区二区主播在线| 日韩网站在线看片你懂的| 亚洲国产精品天堂| 一本色道久久综合精品竹菊| 国产精品久久久久久久久图文区 | 色综合色狠狠综合色| 欧美韩国一区二区| 国产福利一区在线| 久久女同精品一区二区| 免播放器亚洲一区| 日韩一区二区三区三四区视频在线观看| 一区二区三区色| 一本一道久久a久久精品| 综合久久久久综合| 99精品久久免费看蜜臀剧情介绍| 国产亚洲成aⅴ人片在线观看| 九九精品一区二区| 欧美大白屁股肥臀xxxxxx| 免费久久99精品国产| 日韩欧美在线1卡| 国产精品一区免费在线观看| 精品成人佐山爱一区二区| 裸体歌舞表演一区二区| 亚洲精品一区二区三区在线观看| 蜜桃av噜噜一区| 精品国产免费久久| 激情综合色播激情啊| 久久嫩草精品久久久精品| 国产精品99久久久久久久vr| 国产午夜亚洲精品羞羞网站| 国产福利一区二区三区在线视频| 欧美国产日韩一二三区| 99久久精品免费看| 一区二区三区四区激情 | 91亚洲国产成人精品一区二区三 | 成人少妇影院yyyy| 综合久久综合久久| 在线一区二区视频| 日韩在线播放一区二区| 久久综合国产精品| 成人毛片老司机大片| 亚洲精品欧美综合四区| 6080国产精品一区二区| 国产美女视频一区| 综合在线观看色| 欧美美女bb生活片| 国产麻豆视频精品| 亚洲最快最全在线视频| 欧美一区二区三区性视频| 久草在线在线精品观看| 日韩一区中文字幕| 欧美老年两性高潮| 国产精品资源网站| 亚洲精品第一国产综合野| 日韩欧美国产小视频|