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

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

?? pppsecretlib.c

?? vxworks的源代碼
?? C
字號:
/* pppSecretLib.c - PPP authentication secrets library *//* Copyright 1995 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01g,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).01f,20aug98,fle  doc : removed tab from func headers01e,19dec95,vin  doc tweaks.01d,11jul95,dzb  doc tweaks.01c,06jul95,dzb  added doc.01b,13jun95,dzb  cleaned up i960 compiler warning.  header file consolidation.01a,08may95,dzb  written.*//*DESCRIPTIONThis library provides routines to create and manipulate a table of"secrets" for use with Point-to-Point Protocol (PPP) user authenticationprotocols.  The secrets in the secrets table can be searched by peers ona PPP link so that one peer (client) can send a secret word to the otherpeer (server).  If the client cannot find a suitable secret whenrequired to do so, or the secret received by the server is notvalid, the PPP link may be terminated.This library is automatically linked into the VxWorks system image whenthe configuration macro INCLUDE_PPP is defined.INCLUDE FILES: pppLib.hSEE ALSO: pppLib, pppShow,.pG "Network"*//* includes */#include "vxWorks.h"#include "string.h"#include "stdlib.h"#include "stdio.h"#include "errnoLib.h"#include "semLib.h"#include "pppLib.h"/* globals */PPP_SECRET *	pppSecretHead = NULL;		/* head of table linked list *//* locals */LOCAL SEM_ID 	pppSemId = NULL;		/* protect access to table *//********************************************************************************* pppSecretLibInit - initialize the PPP authentication secrets table facility** This routine links the PPP secrets facility into the VxWorks system image.* It is called from usrNetwork.c when the configuration macro INCLUDE_PPP* is defined.** RETURNS: N/A** NOMANUAL*/STATUS pppSecretLibInit (void)    {    if (pppSemId == NULL)		/* already initialized? */        if ((pppSemId = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE))	    == NULL)            return (ERROR);    return (OK);    }/********************************************************************************* pppSecretAdd - add a secret to the PPP authentication secrets table** This routine adds a secret to the Point-to-Point Protocol (PPP)* authentication secrets table.  This table may be used by the* Password Authentication Protocol (PAP) and Challenge-Handshake* Authentication Protocol (CHAP) user authentication protocols.** When a PPP link is established, a "server" may require a "client" to* authenticate itself using a "secret".  Clients and servers obtain* authentication secrets by searching secrets files, or by searching* the secrets table constructed by this routine.  Clients and servers* search the secrets table by matching client and server names with table* entries, and retrieving the associated secret.** Client and server names in the table consisting of "*" are considered* wildcards; they serve as matches for any client and/or server name if* an exact match cannot be found.** If <secret> starts with "@", <secret> is assumed to be the name of a file,* wherein the actual secret can be read.** If <addrs> is not NULL, it should contain a list of acceptable client IP* addresses.   When a server is authenticating a client and the client's* IP address is not contained in the list of acceptable addresses,* the link is terminated.  Any IP address will be considered acceptable* if <addrs> is NULL.  If this parameter is "-", all IP addresses are* disallowed.* * RETURNS: OK, or ERROR if the secret cannot be added to the table.** SEE ALSO: pppSecretDelete(), pppSecretShow()*/STATUS pppSecretAdd    (    char *		client,		/* client being authenticated */    char *		server,		/* server performing authentication */    char *		secret,		/* secret used for authentication */    char *		addrs		/* acceptable client IP addresses */    )    {    PPP_SECRET *	pSecret;		/* pointer to new secret */    if (pppSemId == NULL)	{        errno = S_pppSecretLib_NOT_INITIALIZED;	return (ERROR);	}    if ((pSecret = (PPP_SECRET *) calloc (1, sizeof (struct ppp_secret))) ==	NULL)	return (ERROR);    /* copy secret information */    if (client)        strcpy (pSecret->client, client);    if (server)        strcpy (pSecret->server, server);		    if (secret)        strcpy (pSecret->secret, secret);    if (addrs)        strcpy (pSecret->addrs, addrs);    /* hook into secret list */    semTake (pppSemId, WAIT_FOREVER);		/* exclusive access to list */    pSecret->secretNext = pppSecretHead;	/* put secret on front */    pppSecretHead = pSecret;    semGive (pppSemId);				/* give up access */    return (OK);    }/********************************************************************************* pppSecretDelete - delete a secret from the PPP authentication secrets table** This routine deletes a secret from the Point-to-Point Protocol (PPP)* authentication secrets table.  When searching for a secret to delete* from the table, the wildcard substitution (using "*") is not performed for* client and/or server names.  The <client>, <server>, and <secret>* strings must match the table entry exactly in order to be deleted.** RETURNS: OK, or ERROR if the table entry being deleted is not found.** SEE ALSO: pppSecretAdd(), pppSecretShow()*/STATUS pppSecretDelete    (    char *		client,		/* client being authenticated */    char *		server,		/* server performing authentication */    char *		secret		/* secret used for authentication */    )    {    PPP_SECRET *	pSecret;    PPP_SECRET **	ppPrev;			/* list trailer */    if (pppSemId == NULL)	{        errno = S_pppSecretLib_NOT_INITIALIZED;	return (ERROR);	}    semTake (pppSemId, WAIT_FOREVER);		/* exclusive access to list */    /* find secret */    ppPrev = &pppSecretHead;    for (pSecret = pppSecretHead; pSecret != NULL; pSecret =	pSecret->secretNext)        {        if ((!strcmp (client, pSecret->client)) &&           (!strcmp (server, pSecret->server)) &&           (!strcmp (secret, pSecret->secret)))	    break;        ppPrev = &pSecret->secretNext;		/* update list trailer */        }     if (pSecret != NULL)        *ppPrev = pSecret->secretNext;    /* unhook from secret list */    semGive (pppSemId);				/* give up access */    if (pSecret == NULL)			/* secret found ? */	{        errno = S_pppSecretLib_SECRET_DOES_NOT_EXIST;	return (ERROR);	}    free (pSecret);				/* free secret */    return (OK);    }/********************************************************************************* pppSecretFind - find the best-fit secret in the PPP auth. secrets table** This routine searches the PPP authentication secrets table for a suitable* secret to authenticate the given <client> and <server>.  The secret is* returned in the <secret> parameter.  The list of authorized client IP* addresses are returned in the <ppAddrs> parameter.  If the secret starts* with "@", the secret is taken to be a filename, wherein which the actual* secret is read.* * RETURNS: flag determining strength of the secret, or ERROR if no* suitable secret could be found.** NOMANUAL*/int pppSecretFind    (    char *		client,		/* client being authenticated */    char *		server,		/* server performing authentication */    char *		secret,		/* secret used for authentication */    struct wordlist **	ppAddrs    )    {    PPP_SECRET *	pSecret = NULL;    PPP_SECRET *	pEntry;    char 		atfile [MAXWORDLEN];    char		word [MAXWORDLEN];    char *		pWord;    char *		separators = {" \t"};    char *		pAddr;    char *		pLast = NULL;    FILE *		sf;    int			got_flag = 0;    int			best_flag = -1;    int			xxx;    struct wordlist *	addr_list = NULL;    struct wordlist *	addr_last = NULL;    struct wordlist *	ap;    if (pppSemId == NULL)	{        errno = S_pppSecretLib_NOT_INITIALIZED;	return (ERROR);	}    semTake (pppSemId, WAIT_FOREVER);		/* exclusive access to list */    /* find best secret entry */    for (pEntry = pppSecretHead; pEntry != NULL; pEntry = pEntry->secretNext)	{         /* check for a match */	if (((client != NULL) && client[0] && strcmp (client, pEntry->client)            && !ISWILD (pEntry->client)) ||            ((server != NULL) && server[0] && strcmp (server, pEntry->server)            && !ISWILD (pEntry->server)))            continue;        if (!ISWILD (pEntry->client))            got_flag = NONWILD_CLIENT;        if (!ISWILD (pEntry->server))            got_flag |= NONWILD_SERVER;         if (got_flag > best_flag)            {            pSecret = pEntry;			/* update best entry */	    best_flag = got_flag;            }        }    semGive (pppSemId);				/* give up access */    if (pSecret == NULL)			/* secret found ? */	{        errno = S_pppSecretLib_SECRET_DOES_NOT_EXIST;	return (ERROR);	}    /* check for special syntax: @filename means read secret from file */    if (secret != NULL)	{        if (pSecret->secret[0] == '@')            {            strcpy (atfile, pSecret->secret + 1);            if ((sf = fopen(atfile, "r")) == NULL)		{                syslog (LOG_ERR, "can't open indirect secret file %s",		    atfile);                fclose (sf);	        return (ERROR);		}            check_access (sf, atfile);            if (!getword (sf, word, &xxx, atfile))		{                syslog (LOG_ERR, "no secret in indirect secret file %s",		    atfile);                fclose (sf);	        return (ERROR);		}            fclose (sf);            strcpy (secret, word);            }        else            strcpy (secret, pSecret->secret);	/* stuff secret for return */        }    /* read address authorization info and make a wordlist */    if (ppAddrs != NULL)	{        *ppAddrs = NULL;			/* tie off in case error */        strcpy (word, pSecret->addrs);	pWord = word;        while ((pAddr = strtok_r (pWord, separators, &pLast)) != NULL)	    {	    pWord = NULL;            if ((ap = (struct wordlist *) malloc (sizeof (struct wordlist)                                        + strlen (pAddr))) == NULL)                novm("authorized addresses");            ap->next = NULL;            strcpy (ap->word, pAddr);		/* stuff word */            if (addr_list == NULL)                addr_list = ap;			/* first word */            else                addr_last->next = ap;		/* tie in subsequent words */            addr_last = ap;			/* bump current word pointer */            }        *ppAddrs = addr_list;			/* hook wordlist for return */        }     return (best_flag);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆视频精品| 成人综合在线观看| 欧美一区二区视频网站| 日韩免费看的电影| 91福利区一区二区三区| 成人精品视频一区| 欧美一区二区三区视频在线观看| 中文字幕一区在线观看| 日韩一区在线免费观看| 久久精品国产99久久6| 麻豆精品一区二区av白丝在线| 日韩高清一区二区| 三级亚洲高清视频| 蜜臀a∨国产成人精品| 91国产成人在线| 国产精品美女久久久久高潮 | 亚洲欧洲制服丝袜| 精品午夜久久福利影院| 午夜激情综合网| ...av二区三区久久精品| 久久99精品久久久| 欧美丰满高潮xxxx喷水动漫| 欧美久久久久中文字幕| 亚洲综合网站在线观看| 日本最新不卡在线| 欧美色精品在线视频| 欧美一区二区精美| 婷婷综合久久一区二区三区| 91久久香蕉国产日韩欧美9色| 日韩一区在线看| av影院午夜一区| 欧美日韩精品一区二区| 久久五月婷婷丁香社区| 亚洲欧美中日韩| 99久久99久久精品免费看蜜桃| 欧美一区二区在线免费播放| 婷婷六月综合网| 欧美大胆人体bbbb| 国产一区二区视频在线播放| 久久伊人中文字幕| 成人国产一区二区三区精品| 91精品国产一区二区三区蜜臀 | 亚洲一二三四在线观看| 91豆麻精品91久久久久久| 亚洲国产乱码最新视频 | 一区二区高清在线| 国产精品99久久不卡二区| 欧美日韩一区三区| 日韩影院精彩在线| 日韩欧美亚洲国产另类| 国产一区二区精品久久99| 亚洲国产精品av| 日本女人一区二区三区| 久久久亚洲精品一区二区三区| 亚洲伦在线观看| 成人午夜av在线| 亚洲激情欧美激情| 欧美mv日韩mv国产| 日本午夜一区二区| 久久噜噜亚洲综合| 91美女片黄在线观看| 国产色婷婷亚洲99精品小说| 日本va欧美va瓶| 欧美久久久久久久久| 国产麻豆欧美日韩一区| 亚洲色图清纯唯美| eeuss鲁片一区二区三区在线看| 亚洲黄色尤物视频| 精品国产凹凸成av人网站| 开心九九激情九九欧美日韩精美视频电影| 久久天堂av综合合色蜜桃网| 91丨国产丨九色丨pron| 久久99精品久久久| 亚洲在线成人精品| 国产女同互慰高潮91漫画| 国产综合久久久久影院| 精品国产乱码久久久久久免费| 成人小视频免费观看| 青青草原综合久久大伊人精品优势| 国产亚洲欧美日韩在线一区| 69堂成人精品免费视频| 午夜欧美2019年伦理| 国产女同互慰高潮91漫画| 777奇米四色成人影色区| 99久久国产综合精品色伊| 美女视频黄频大全不卡视频在线播放| 亚洲色图在线播放| 国产欧美一区二区三区网站| 制服丝袜激情欧洲亚洲| 91福利国产精品| 成人av在线看| 国产成人av自拍| 亚洲天堂中文字幕| 久久人人超碰精品| 日韩一区二区视频| 国产一区二区美女| 免费不卡在线观看| 性欧美疯狂xxxxbbbb| 精品国产精品网麻豆系列 | 性做久久久久久| 亚洲色图一区二区三区| 国产精品―色哟哟| 国产日韩欧美不卡| 久久精品亚洲精品国产欧美| 欧美大片一区二区三区| 欧美精品在欧美一区二区少妇| 日本高清免费不卡视频| 99精品偷自拍| 91在线观看下载| 不卡的电视剧免费网站有什么| 国产一区二区三区四| 国产精品中文字幕一区二区三区| 久久成人免费网| 久久超碰97人人做人人爱| 精品制服美女丁香| 久久99精品久久久久久久久久久久| 日韩国产精品91| 麻豆视频一区二区| 国产综合色产在线精品| 国产最新精品精品你懂的| 国产乱子伦视频一区二区三区 | 在线观看免费一区| 国产一区在线观看麻豆| 国产又粗又猛又爽又黄91精品| 国产一区二区美女诱惑| 成人午夜激情影院| 色天天综合久久久久综合片| 精品一区二区三区不卡| 国产一区日韩二区欧美三区| 国产精品99久久久| 日本电影亚洲天堂一区| 在线不卡的av| 久久综合九色综合97婷婷女人| 亚洲成a人v欧美综合天堂| 人人超碰91尤物精品国产| 国产精品成人一区二区艾草| 国产精品久久午夜夜伦鲁鲁| 午夜av一区二区三区| 日本精品视频一区二区| 337p亚洲精品色噜噜狠狠| 日韩午夜激情免费电影| 国产.欧美.日韩| 尤物在线观看一区| 日韩精品五月天| 国产成人在线免费| 色先锋aa成人| 日韩欧美一级二级三级| 国产精品三级视频| 午夜免费久久看| 国产乱码一区二区三区| 欧洲一区在线电影| 久久精品欧美日韩精品| 亚洲一区二区三区四区在线 | 亚洲高清三级视频| 精品一区二区三区久久久| 成人国产精品免费网站| 精品视频1区2区3区| 国产清纯白嫩初高生在线观看91 | 国产在线乱码一区二区三区| 成人黄色小视频在线观看| 欧美午夜在线观看| 91丝袜呻吟高潮美腿白嫩在线观看| 91搞黄在线观看| 国产婷婷色一区二区三区在线| 亚洲国产精品一区二区久久| 国产在线视频精品一区| 欧美午夜片在线观看| 国产精品三级电影| 蜜臀av一区二区三区| 在线观看av不卡| 国产精品成人一区二区三区夜夜夜| 久久国产欧美日韩精品| 欧美日韩一区高清| 亚洲精品网站在线观看| 成人三级伦理片| 精品国产网站在线观看| 午夜国产精品一区| 色视频一区二区| 国产精品九色蝌蚪自拍| 国产mv日韩mv欧美| 久久综合久久综合久久综合| 久久综合综合久久综合| 欧美精品粉嫩高潮一区二区| 亚洲一区二区成人在线观看| 99国产精品国产精品久久| 久久精品欧美一区二区三区不卡| 日韩不卡一区二区| 欧美日韩一区成人| 亚洲一区免费视频| 日本精品一区二区三区四区的功能| 日本一区二区免费在线观看视频| 国产一区二三区| 精品国产露脸精彩对白| 久久国产人妖系列| 精品美女一区二区三区| 久久成人免费电影| 精品av久久707| 国产精品一级黄| 国产精品毛片大码女人| 99久久99久久综合|