亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产原创一区二区| 处破女av一区二区| 国产精品国产三级国产aⅴ无密码| 色哟哟日韩精品| 蜜臀av国产精品久久久久| 国产精品国产三级国产a| 日韩欧美一级特黄在线播放| 91国内精品野花午夜精品| 国产精品一区在线观看你懂的| 亚洲福利一二三区| 中文字幕在线不卡视频| 精品国产三级电影在线观看| 欧美日韩国产一级片| 91一区二区在线观看| 国产福利91精品一区| 久久精品国产秦先生| 日韩在线观看一区二区| 一区二区三区四区五区视频在线观看| 久久久久久久国产精品影院| 日韩一级黄色片| 91精品国产色综合久久ai换脸| 91成人看片片| 一本色道亚洲精品aⅴ| 不卡av免费在线观看| 国产99久久久国产精品免费看| 狠狠色综合色综合网络| 麻豆高清免费国产一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲风情在线资源站| 亚洲综合激情网| 一区二区三区.www| 亚洲一区二区三区自拍| 一区二区三区欧美激情| 亚洲精品国产a久久久久久| 日韩一区中文字幕| **性色生活片久久毛片| 国产精品久久99| 国产精品久久三区| 国产精品动漫网站| 亚洲精品日韩一| 亚洲第一在线综合网站| 香蕉久久夜色精品国产使用方法| 亚洲成人免费观看| 欧美96一区二区免费视频| 免费观看在线色综合| 精品一区二区在线观看| 国产成人免费在线观看不卡| 国产夫妻精品视频| av电影在线观看完整版一区二区| 99久久精品免费| 在线视频国内一区二区| 欧美日韩精品久久久| 91精品国产福利在线观看| 日韩一区二区高清| 日本一区二区三区免费乱视频 | 一本色道久久综合亚洲aⅴ蜜桃| 91在线观看高清| 欧美日韩情趣电影| 欧美成人免费网站| 国产精品久久久久久久午夜片| 亚洲免费看黄网站| 日韩精品久久久久久| 国产一区二区三区在线观看免费 | 一区二区日韩电影| 日本中文在线一区| 国产99精品国产| 91久久人澡人人添人人爽欧美| 777a∨成人精品桃花网| 精品日韩在线观看| 亚洲天堂av老司机| 日本美女视频一区二区| 高清视频一区二区| 欧美日韩一级二级| 国产无人区一区二区三区| 亚洲精品国产第一综合99久久 | 色94色欧美sute亚洲线路一ni | 色悠悠久久综合| 56国语精品自产拍在线观看| 久久丝袜美腿综合| 一区二区高清视频在线观看| 免费成人在线视频观看| 成人精品国产一区二区4080| 欧美性一级生活| 国产欧美视频一区二区| 亚洲成av人综合在线观看| 国产精品综合网| 欧美日韩精品专区| 中文字幕亚洲欧美在线不卡| 日韩精品一级二级| 91在线高清观看| 2021国产精品久久精品| 亚洲国产中文字幕在线视频综合 | 日韩国产欧美三级| av毛片久久久久**hd| 欧美岛国在线观看| 亚洲免费视频中文字幕| 国产九九视频一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 中文欧美字幕免费| 美国十次了思思久久精品导航| 91在线云播放| 中文字幕欧美日韩一区| 日本不卡一二三| 欧美性高清videossexo| 国产精品进线69影院| 精品一区二区三区影院在线午夜| 欧美日韩一区 二区 三区 久久精品| 久久精品视频网| 免费日韩伦理电影| 欧美日韩高清在线播放| 中文字幕一区二区三| 懂色av中文字幕一区二区三区| 日韩亚洲欧美一区二区三区| 亚洲国产欧美另类丝袜| 色综合网色综合| 国产精品久久久久天堂| 成人永久免费视频| 久久精品一区蜜桃臀影院| 蜜臀av性久久久久蜜臀av麻豆| 欧美日韩一区二区三区在线 | 136国产福利精品导航| 国产成人综合自拍| 久久精品欧美日韩精品| 国内外精品视频| 欧美电影免费观看高清完整版在线 | 成人免费视频app| 欧美国产欧美综合| 伦理电影国产精品| 日韩欧美一区二区不卡| 免费在线观看不卡| 欧美一区二区女人| 久久精品久久99精品久久| 日韩欧美一区电影| 韩国三级电影一区二区| 精品久久久网站| 国产一区二区看久久| 久久精品水蜜桃av综合天堂| 国产精品系列在线播放| 国产欧美一区二区在线观看| 国产精品18久久久久久久久| 久久精品亚洲一区二区三区浴池 | 成人午夜又粗又硬又大| 亚洲国产高清aⅴ视频| 99国产精品久久久久久久久久久 | 狠狠色丁香久久婷婷综| 久久蜜桃香蕉精品一区二区三区| 国产在线播放一区| 国产精品国产三级国产普通话99| 91一区二区三区在线观看| 一区二区在线看| 欧美精品三级在线观看| 蜜桃视频在线观看一区| 亚洲精品一区二区在线观看| 国产成人丝袜美腿| 亚洲男人的天堂av| 日本一区二区成人| 欧美午夜精品免费| 精品动漫一区二区三区在线观看| 亚洲视频在线一区二区| 日本大香伊一区二区三区| 视频一区欧美日韩| 精品国产乱码久久久久久图片 | 亚洲精品福利视频网站| 欧美精品九九99久久| 精品亚洲成a人| 中文字幕日韩一区二区| 欧美在线视频不卡| 国产精品综合一区二区| 亚洲精品久久7777| 精品久久国产97色综合| eeuss鲁片一区二区三区在线观看| 亚洲尤物视频在线| 精品国产在天天线2019| 一本到高清视频免费精品| 日韩制服丝袜先锋影音| 中文字幕av一区二区三区| 欧美精品在欧美一区二区少妇| 国精产品一区一区三区mba视频| 中文字幕在线观看一区| 欧美日韩高清在线| 成人18视频日本| 青青青伊人色综合久久| 国产精品剧情在线亚洲| 欧美精品久久99| 91亚洲精品久久久蜜桃网站 | 久久99国产精品免费网站| 国产精品久久久久久久久图文区 | 日韩欧美国产三级| 国产一区啦啦啦在线观看| 亚洲综合在线电影| 国产无人区一区二区三区| 欧美精品黑人性xxxx| 99久久精品免费精品国产| 另类小说图片综合网| 亚洲综合色噜噜狠狠| 中文幕一区二区三区久久蜜桃| 日韩欧美国产小视频| 欧美三级午夜理伦三级中视频| 成人午夜在线视频| 国产一区二区美女诱惑|