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

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

?? pppsecretlib.c

?? vxwork源代碼
?? 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一区二区三区免费野_久草精品视频
亚洲三级在线免费| 99riav久久精品riav| 粉嫩在线一区二区三区视频| 在线观看日韩电影| 国产精品不卡在线| 国产成人综合自拍| 欧美电影免费观看高清完整版在线| 成人免费一区二区三区在线观看 | 精品国产91洋老外米糕| 亚洲人xxxx| 成人综合在线观看| 久久亚洲一级片| 蜜桃精品在线观看| 欧美日本视频在线| 亚洲与欧洲av电影| 91丨porny丨首页| 中文字幕乱码日本亚洲一区二区| 老司机精品视频导航| 欧美丰满一区二区免费视频| 亚洲精品免费电影| 色域天天综合网| 亚洲精选视频免费看| 91丨porny丨国产| 国产精品欧美一区二区三区| 国产成人在线色| 国产网站一区二区| 国产老肥熟一区二区三区| 精品国产乱码久久久久久1区2区 | 亚洲成人你懂的| 欧美亚洲国产一区在线观看网站| 最新高清无码专区| 91亚洲精品一区二区乱码| 中文在线资源观看网站视频免费不卡| 国产综合久久久久影院| 久久九九影视网| 成人av在线一区二区| 国产精品美女久久久久久2018| 成人精品视频一区二区三区尤物| 中文字幕二三区不卡| 欧美网站大全在线观看| 日本视频免费一区| 在线不卡a资源高清| 午夜精品福利一区二区蜜股av | 国产综合色精品一区二区三区| 日韩小视频在线观看专区| 美美哒免费高清在线观看视频一区二区| 91精品国产麻豆国产自产在线 | 99久久er热在这里只有精品66| 精品黑人一区二区三区久久| 国产精品一级黄| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91激情在线视频| 日韩和欧美一区二区三区| 精品日韩一区二区三区免费视频| 国产中文一区二区三区| 亚洲视频一二三| 555夜色666亚洲国产免| 国产一级精品在线| 亚洲欧洲色图综合| 欧美一级高清片| 国产成人丝袜美腿| 亚洲一区精品在线| 精品国产乱码久久久久久久久| 成av人片一区二区| 日韩成人伦理电影在线观看| 久久精品视频在线看| 欧美三级蜜桃2在线观看| 久久99精品一区二区三区| 亚洲欧美一区二区三区国产精品 | 国产偷国产偷精品高清尤物| 91一区一区三区| 久久国产精品99精品国产| 综合欧美亚洲日本| 精品国产网站在线观看| 色老汉一区二区三区| 国产一区二区视频在线播放| 一区二区高清视频在线观看| 久久免费视频一区| 欧美三日本三级三级在线播放| 国产夫妻精品视频| 日韩在线一区二区| 亚洲欧洲日产国产综合网| 欧美大胆一级视频| 精品视频在线免费观看| 丰满亚洲少妇av| 老色鬼精品视频在线观看播放| 一级日本不卡的影视| 欧美国产日韩一二三区| 91精品久久久久久蜜臀| 欧美中文字幕不卡| av在线一区二区| 成人中文字幕在线| 久久草av在线| 青青草原综合久久大伊人精品优势 | 亚洲一区二区视频在线观看| 国产精品每日更新| 亚洲精品一区二区三区四区高清| 欧美性感一类影片在线播放| 99国产精品国产精品毛片| 国产精品一区二区x88av| 日韩av中文字幕一区二区三区| 亚洲va在线va天堂| 亚洲一区电影777| 一区二区三区丝袜| 亚洲乱码日产精品bd| 1区2区3区欧美| 中文字幕一区二区三区av| 国产精品成人免费精品自在线观看| 国产清纯美女被跳蛋高潮一区二区久久w| 精品日韩一区二区| 26uuuu精品一区二区| xf在线a精品一区二区视频网站| 日韩精品一区二区三区在线观看| 欧美一区二区播放| 在线国产电影不卡| 一本大道久久精品懂色aⅴ| 国产高清在线观看免费不卡| 久久国产精品99久久久久久老狼| 午夜视频一区二区三区| 亚洲激情六月丁香| 国产精品电影一区二区三区| 久久久久久久久久久久久夜| 2024国产精品| 久久影音资源网| 国产三区在线成人av| 亚洲永久免费视频| 欧美伊人精品成人久久综合97 | 成人av网站在线| 99精品视频一区| 精品视频色一区| 欧美一级一区二区| 2023国产精品| 综合久久综合久久| 五月婷婷综合网| 国产美女主播视频一区| 成人国产精品免费| 欧美三级三级三级| 欧美精品一区二区三区视频 | 三级一区在线视频先锋 | 性做久久久久久| 精品无码三级在线观看视频| 国产成人免费9x9x人网站视频| 91在线观看免费视频| 7878成人国产在线观看| 久久综合国产精品| 国产精品剧情在线亚洲| 亚洲超碰精品一区二区| 狠狠色丁香婷综合久久| 91免费小视频| 精品免费国产二区三区| 亚洲欧美一区二区三区国产精品| 日本在线不卡一区| 91一区二区三区在线播放| 精品美女一区二区| 一区二区三区成人| 国内成+人亚洲+欧美+综合在线| 色婷婷久久99综合精品jk白丝| 日韩三级视频中文字幕| 亚洲丝袜另类动漫二区| 六月丁香婷婷久久| 在线日韩国产精品| 国产欧美日韩另类视频免费观看| 亚洲成年人网站在线观看| 国产风韵犹存在线视精品| 在线电影院国产精品| 亚洲特级片在线| 国产成a人无v码亚洲福利| 51精品久久久久久久蜜臀| 日韩一区有码在线| 国产精品一级黄| 精品美女一区二区| 日本在线不卡视频| 精品婷婷伊人一区三区三| 国产性色一区二区| 无码av免费一区二区三区试看| 成人h动漫精品| 久久精品亚洲国产奇米99| 美女mm1313爽爽久久久蜜臀| 欧美三级韩国三级日本三斤 | 欧美无人高清视频在线观看| 国产三区在线成人av| 狠狠色狠狠色综合| 欧美xxxx老人做受| 奇米一区二区三区av| 8x8x8国产精品| 日韩黄色小视频| 欧美一区二区三区四区在线观看| 日本成人在线看| 欧美一区二区三区电影| 偷拍一区二区三区四区| 在线观看av一区二区| 亚洲综合成人在线视频| 色婷婷综合久久久久中文一区二区| 最好看的中文字幕久久| 色婷婷精品大在线视频| 亚洲欧美一区二区三区孕妇| 一本色道亚洲精品aⅴ| 樱花草国产18久久久久| 91福利视频久久久久| 亚洲制服欧美中文字幕中文字幕|