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

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

?? rpc.prog.ms

?? 早期freebsd實(shí)現(xiàn)
?? MS
?? 第 1 頁 / 共 5 頁
字號(hào):
	SVCXPRT *transp;{	char *s = NULL;	switch (rqstp->rq_proc) {	case NULLPROC:		if (!svc_sendreply(transp, xdr_void, 0)) 			fprintf(stderr, "can't reply to RPC call\en");		return;	case RENDERSTRING:		if (!svc_getargs(transp, xdr_wrapstring, &s)) {			fprintf(stderr, "can't decode arguments\en");.ft I			/*			 * Tell caller he screwed up			 */.ft CW			svcerr_decode(transp);			break;		}.ft I		/*		 * Code here to render the string \fIs\fP		 */.ft CW		if (!svc_sendreply(transp, xdr_void, NULL)) 			fprintf(stderr, "can't reply to RPC call\en");		break;	case RENDERSTRING_BATCHED:		if (!svc_getargs(transp, xdr_wrapstring, &s)) {			fprintf(stderr, "can't decode arguments\en");.ft I			/*			 * We are silent in the face of protocol errors			 */.ft CW			break;		}.ft I		/*		 * Code here to render string s, but send no reply!		 */.ft CW		break;	default:		svcerr_noproc(transp);		return;	}.ft I	/*	 * Now free string allocated while decoding arguments	 */.ft CW	svc_freeargs(transp, xdr_wrapstring, &s);}.DEOf course the service could have one procedurethat takes the string and a booleanto indicate whether or not the procedure should respond..LPIn order for a client to take advantage of batching,the client must perform RPC calls on a TCP-based transportand the actual calls must have the following attributes:1) the result's XDR routine must be zero.I NULL ),and 2) the RPC call's timeout must be zero..KS.LPHere is an example of a client that uses batching to render abunch of strings; the batching is flushed when the client getsa null string (EOF):.ie t .DS.el .DS L.ft CW.vs 11#include <stdio.h>#include <rpc/rpc.h>#include <sys/socket.h>#include <sys/time.h>#include <netdb.h>#include <suntool/windows.h>main(argc, argv)	int argc;	char **argv;{	struct hostent *hp;	struct timeval pertry_timeout, total_timeout;	struct sockaddr_in server_addr;	int sock = RPC_ANYSOCK;	register CLIENT *client;	enum clnt_stat clnt_stat;	char buf[1000], *s = buf;	if ((client = clnttcp_create(&server_addr,	  WINDOWPROG, WINDOWVERS, &sock, 0, 0)) == NULL) {		perror("clnttcp_create");		exit(-1);	}	total_timeout.tv_sec = 0;	total_timeout.tv_usec = 0;	while (scanf("%s", s) != EOF) {		clnt_stat = clnt_call(client, RENDERSTRING_BATCHED,			xdr_wrapstring, &s, NULL, NULL, total_timeout);		if (clnt_stat != RPC_SUCCESS) {			clnt_perror(client, "batched rpc");			exit(-1);		}	}	/* \fINow flush the pipeline\fP */	total_timeout.tv_sec = 20;	clnt_stat = clnt_call(client, NULLPROC, xdr_void, NULL,		xdr_void, NULL, total_timeout);	if (clnt_stat != RPC_SUCCESS) {		clnt_perror(client, "rpc");		exit(-1);	}	clnt_destroy(client);	exit(0);}.vs.DE.KESince the server sends no message,the clients cannot be notified of any of the failures that may occur.Therefore, clients are on their own when it comes to handling errors..LPThe above example was completed to renderall of the (2000) lines in the file.I /etc/termcap .The rendering service did nothing but throw the lines away.The example was run in the following four configurations:1) machine to itself, regular RPC;2) machine to itself, batched RPC;3) machine to another, regular RPC; and4) machine to another, batched RPC.The results are as follows:1) 50 seconds;2) 16 seconds;3) 52 seconds;4) 10 seconds.Running.I fscanf()on.I /etc/termcaponly requires six seconds.These timings show the advantage of protocolsthat allow for overlapped execution,though these protocols are often hard to design..NH 2\&Authentication.IX "authentication".IX "RPC" "authentication".LPIn the examples presented so far,the caller never identified itself to the server,and the server never required an ID from the caller.Clearly, some network services, such as a network filesystem,require stronger security than what has been presented so far..LPIn reality, every RPC call is authenticated bythe RPC package on the server, and similarly,the RPC client package generates and sends authentication parameters.Just as different transports (TCP/IP or UDP/IP)can be used when creating RPC clients and servers,different forms of authentication can be associated with RPC clients;the default authentication type used as a default is type.I none ..LPThe authentication subsystem of the RPC package is open ended.That is, numerous types of authentication are easy to support..NH 3\&UNIX Authentication.IX "UNIX Authentication".IP "\fIThe Client Side\fP".LPWhen a caller creates a new RPC client handle as in:.DS.ft CWclnt = clntudp_create(address, prognum, versnum,		      wait, sockp).DEthe appropriate transport instance defaultsthe associate authentication handle to be.DS.ft CWclnt->cl_auth = authnone_create();.DEThe RPC client can choose to use.I UNIXstyle authentication by setting.I clnt\->cl_authafter creating the RPC client handle:.DS.ft CWclnt->cl_auth = authunix_create_default();.DEThis causes each RPC call associated with.I clntto carry with it the following authentication credentials structure:.ie t .DS.el .DS L.ft I/* * UNIX style credentials. */.ft CWstruct authunix_parms {    u_long  aup_time;       /* \fIcredentials creation time\fP */    char    *aup_machname;  /* \fIhost name where client is\fP */    int     aup_uid;        /* \fIclient's UNIX effective uid\fP */    int     aup_gid;        /* \fIclient's current group id\fP */    u_int   aup_len;        /* \fIelement length of aup_gids\fP */    int     *aup_gids;      /* \fIarray of groups user is in\fP */};.DEThese fields are set by.I authunix_create_default()by invoking the appropriate system calls.Since the RPC user created this new style of authentication,the user is responsible for destroying it with:.DS.ft CWauth_destroy(clnt->cl_auth);.DEThis should be done in all cases, to conserve memory..sp.IP "\fIThe Server Side\fP".LPService implementors have a harder time dealing with authentication issuessince the RPC package passes the service dispatch routine a requestthat has an arbitrary authentication style associated with it.Consider the fields of a request handle passed to a service dispatch routine:.ie t .DS.el .DS L.ft I/* * An RPC Service request */.ft CWstruct svc_req {    u_long    rq_prog;    	/* \fIservice program number\fP */    u_long    rq_vers;    	/* \fIservice protocol vers num\fP */    u_long    rq_proc;    	/* \fIdesired procedure number\fP */    struct opaque_auth rq_cred; /* \fIraw credentials from wire\fP */    caddr_t   rq_clntcred;  /* \fIcredentials (read only)\fP */};.DEThe.I rq_credis mostly opaque, except for one field of interest:the style or flavor of authentication credentials:.ie t .DS.el .DS L.ft I/* * Authentication info.  Mostly opaque to the programmer. */.ft CWstruct opaque_auth {    enum_t  oa_flavor;  /* \fIstyle of credentials\fP */    caddr_t oa_base;    /* \fIaddress of more auth stuff\fP */    u_int   oa_length;  /* \fInot to exceed \fIMAX_AUTH_BYTES */};.DE.IX RPC guaranteesThe RPC package guarantees the followingto the service dispatch routine:.IP  1.That the request's.I rq_credis well formed.  Thus the service implementor may inspect the request's.I rq_cred.oa_flavorto determine which style of authentication the caller used.The service implementor may also wish to inspect the other fields of.I rq_credif the style is not one of the styles supported by the RPC package..IP  2.That the request's.I rq_clntcredfield is either.I NULL or points to a well formed structurethat corresponds to a supported style of authentication credentials.Remember that only.I unixstyle is currently supported, so (currently).I rq_clntcredcould be cast to a pointer to an.I authunix_parmsstructure.  If.I rq_clntcredis.I NULL ,the service implementor may wish to inspect the other (opaque) fields of.I rq_credin case the service knows about a new type of authenticationthat the RPC package does not know about..LPOur remote users service example can be extended so thatit computes results for all users except UID 16:.ie t .DS.el .DS L.ft CW.vs 11nuser(rqstp, transp)	struct svc_req *rqstp;	SVCXPRT *transp;{	struct authunix_parms *unix_cred;	int uid;	unsigned long nusers;.ft I	/*	 * we don't care about authentication for null proc	 */.ft CW	if (rqstp->rq_proc == NULLPROC) {		if (!svc_sendreply(transp, xdr_void, 0)) {			fprintf(stderr, "can't reply to RPC call\en");			return (1);		 }		 return;	}.ft I	/*	 * now get the uid	 */.ft CW	switch (rqstp->rq_cred.oa_flavor) {	case AUTH_UNIX:		unix_cred = 			(struct authunix_parms *)rqstp->rq_clntcred;		uid = unix_cred->aup_uid;		break;	case AUTH_NULL:	default:		svcerr_weakauth(transp);		return;	}	switch (rqstp->rq_proc) {	case RUSERSPROC_NUM:.ft I		/*		 * make sure caller is allowed to call this proc		 */.ft CW		if (uid == 16) {			svcerr_systemerr(transp);			return;		}.ft I		/*		 * Code here to compute the number of users		 * and assign it to the variable \fInusers\fP		 */.ft CW		if (!svc_sendreply(transp, xdr_u_long, &nusers)) {			fprintf(stderr, "can't reply to RPC call\en");			return (1);		}		return;	default:		svcerr_noproc(transp);		return;	}}.vs.DEA few things should be noted here.First, it is customary not to checkthe authentication parameters associated with the.I NULLPROC(procedure number zero).Second, if the authentication parameter's type is not suitablefor your service, you should call.I svcerr_weakauth() .And finally, the service protocol itself should return statusfor access denied; in the case of our example, the protocoldoes not have such a status, so we call the service primitive.I svcerr_systemerr()instead..LPThe last point underscores the relation betweenthe RPC authentication package and the services;RPC deals only with .I authentication and not with individual services' .I "access control" .The services themselves must implement their own access control policiesand reflect these policies as return statuses in their protocols..NH 2\&DES Authentication.IX RPC DES.IX RPC authentication.LPUNIX authentication is quite easy to defeat.  Instead of using.I authunix_create_default (),one can call.I authunix_create() and then modify the RPC authentication handle it returns by filling inwhatever user ID and hostname they wish the server to think they have.DES authentication is thus recommended for people who want more securitythan UNIX authentication offers..LPThe details of the DES authentication protocol are complicated andare not explained here.  See.I "Remote Procedure Calls: Protocol Specification"for the details..LPIn  order for  DES authentication   to  work, the.I keyserv(8c) daemon must be running  on both  the  server  and client machines.  Theusers on  these machines  need  public  keys  assigned by  the networkadministrator in  the.I publickey(5) database.  And,  they  need to have decrypted  their  secret keysusing  their  login   password.  This automatically happens when onelogs in using.I login(1) ,or can be done manually using.I keylogin(1) .The.I "Network Services"chapter./" XXXexplains more how to setup secure networking..sp.IP "\fIClient Side\fP".LPIf a client wishes to use DES authentication, it must set itsauthentication handle appropriately.  Here is an example:.DScl->cl_auth =	authdes_create(servername, 60, &server_addr, NULL);.DEThe first argument is the network name or \*Qnetname\*U of the owner ofthe server process.  Typically, server processes are root processesand their netname can be derived using the following call:.DSchar servername[MAXNETNAMELEN];host2netname(servername, rhostname, NULL);.DEHere,.I rhostnameis the hostname of the machine the server process is running on..I host2netname() fills in.I servernameto contain this root process's netname.  If theserver process was run by a regular user, one could use the call.I user2netname() instead.  Here is an example for a server process with the same userID as the client:.DSchar servername[MAXNETNAMELEN];user2netname(servername, getuid(), NULL);.DEThe last argument to both of these calls,.I user2netname() and.I host2netname (),is the name of the naming domain where the server is located.  The.I NULL used here means \*Quse the local domain name.\*U.LPThe second argument to.I authdes_create() is a lifetime for the credential.  Here it is set to sixtyseconds.  What that means is that the credential will expire 60seconds from now.  If some mischievous user tries to reuse thecredential, the server RPC subsystem will recognize that it hasexpired and not grant any requests.  If the same mischievous usertries to reuse the credential within the sixty second lifetime,he will still be rejected because the server RPC subsystemremembers which credentials it has already seen in the near past,and will not grant requests to duplicates..LPThe third argument to.I authdes_create() is the address of the host to synchronize with.  In order for DESauthentication to work, the server and client must agree upon thetime.  Here we pass the address of the server itself, so theclient and server will both be using the same time: the server'stime.  The argument can be.I NULL ,which means \*Qdon't bother synchronizing.\*U You should only do thisif you are sure the client and server are already synchronized..LPThe final argument to.I authdes_create() is the address of a DES encryption key to use for encryptingtimestamps and data.  If this argument is.I NULL ,as it is in this example, a random key will be chosen.  The clientmay find out the encryption key being used by consulting the.I ah_key field of the authentication handle.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜久久久久| 亚洲日本在线看| 日韩高清国产一区在线| 色呦呦日韩精品| 日韩一区在线免费观看| thepron国产精品| 久久综合色婷婷| 激情综合五月婷婷| 久久嫩草精品久久久久| 国产老女人精品毛片久久| 久久综合久久综合久久| 国模少妇一区二区三区| 精品国免费一区二区三区| 六月婷婷色综合| 精品成人私密视频| 国产精品一区在线观看你懂的| 26uuu精品一区二区| 狠狠久久亚洲欧美| 久久精品人人做人人综合| 国产乱一区二区| 久久久久99精品国产片| 国产激情精品久久久第一区二区| 国产亚洲欧美激情| kk眼镜猥琐国模调教系列一区二区| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 另类中文字幕网| 337p日本欧洲亚洲大胆色噜噜| 国产精品一二三区| 国产精品高潮久久久久无| 91免费看片在线观看| 亚洲伊人色欲综合网| 91精品国产色综合久久ai换脸 | 依依成人精品视频| 欧美精品v国产精品v日韩精品 | 免费三级欧美电影| 久久无码av三级| aaa欧美日韩| 夜夜精品视频一区二区| 51精品视频一区二区三区| 精品一区二区三区在线播放视频| 久久久久久久久久久久电影| 成人动漫在线一区| 亚洲综合无码一区二区| 日韩欧美国产综合一区| 国产99久久久久| 一区二区三区四区视频精品免费| 9191久久久久久久久久久| 国产一区二区三区电影在线观看| 蜜桃久久久久久| 精品国产髙清在线看国产毛片| 国产91在线观看丝袜| 亚洲一区在线观看网站| 日韩小视频在线观看专区| 国产69精品久久99不卡| 亚洲国产精品久久不卡毛片| 欧美精品一区二区三区视频| av在线不卡观看免费观看| 天堂资源在线中文精品| 国产亚洲女人久久久久毛片| 欧美在线free| 韩国一区二区在线观看| 亚洲人成网站影音先锋播放| 日韩女优视频免费观看| 色综合欧美在线视频区| 麻豆久久久久久久| 亚洲男人的天堂一区二区| 日韩欧美一区二区在线视频| 成人av免费观看| 三级久久三级久久久| 国产精品网友自拍| 欧美一区二区高清| 91麻豆福利精品推荐| 另类专区欧美蜜桃臀第一页| 亚洲素人一区二区| 精品国产免费人成在线观看| 在线免费观看日本欧美| 国产精品一区久久久久| 亚洲福利电影网| 中文字幕制服丝袜成人av| 日韩亚洲欧美在线观看| 色网站国产精品| 国产一区二区0| 亚洲第一福利视频在线| 国产精品传媒在线| 2014亚洲片线观看视频免费| 精品视频一区二区三区免费| 99视频有精品| 国精品**一区二区三区在线蜜桃| 亚洲国产aⅴ天堂久久| 一色屋精品亚洲香蕉网站| 久久欧美中文字幕| 欧美一区二区三区播放老司机| 91首页免费视频| 国产精品一区免费在线观看| 秋霞av亚洲一区二区三| 亚洲自拍偷拍麻豆| 国产精品福利一区| 国产日韩欧美精品在线| 精品理论电影在线观看| 在线电影一区二区三区| 91老师国产黑色丝袜在线| 国产高清久久久| 精品无人区卡一卡二卡三乱码免费卡| 亚洲国产精品久久艾草纯爱| 亚洲欧美国产毛片在线| 国产精品久久久久久久午夜片| 久久综合久久综合久久| 欧美成人精品1314www| 在线成人av影院| 欧美在线播放高清精品| 91黄色免费版| 91最新地址在线播放| 成人综合在线观看| 国产成a人亚洲精| 国产原创一区二区三区| 狠狠色狠狠色综合| 看电视剧不卡顿的网站| 日韩国产高清影视| 一本久道久久综合中文字幕| 高清免费成人av| 国产福利一区在线观看| 国产一区二区三区在线观看免费视频| 麻豆中文一区二区| 蜜桃视频免费观看一区| 美女视频黄免费的久久 | 亚洲图片另类小说| 国产精品久线在线观看| 国产精品久久网站| 国产精品国产三级国产三级人妇 | 欧美电影精品一区二区| 欧美一级艳片视频免费观看| 欧美人与禽zozo性伦| 欧美久久久久免费| 制服丝袜日韩国产| 欧美一区二区视频观看视频| 日韩一区二区三区精品视频| 日韩久久免费av| 日韩一区二区三区视频在线| 欧美一级高清大全免费观看| 日韩欧美中文字幕制服| 精品国产污污免费网站入口 | 精品乱码亚洲一区二区不卡| 日韩精品一区二区三区视频| 精品美女在线观看| 国产亚洲一区字幕| 国产欧美一区二区三区在线看蜜臀| 中文字幕的久久| 亚洲特级片在线| 亚洲国产综合视频在线观看| 日本成人中文字幕在线视频| 国精产品一区一区三区mba视频| 国产精品一区二区在线观看不卡| 国产精品综合一区二区三区| 成人免费av在线| 日本韩国欧美一区| 欧美精品tushy高清| 久久女同性恋中文字幕| 最新热久久免费视频| 亚洲国产精品一区二区www| 日韩av网站在线观看| 国产一区在线看| av色综合久久天堂av综合| 在线观看91视频| 欧美一级高清大全免费观看| 国产午夜精品一区二区三区四区| 亚洲欧洲日产国码二区| 亚欧色一区w666天堂| 激情久久久久久久久久久久久久久久| 国产成人av电影| 色综合天天性综合| 91精品在线一区二区| 久久久精品日韩欧美| 亚洲日本成人在线观看| 日韩和欧美一区二区| 国产精品亚洲а∨天堂免在线| 日本精品一级二级| 欧美成人video| 国产精品大尺度| 日韩精彩视频在线观看| 大白屁股一区二区视频| 欧美久久一二区| 亚洲国产成人在线| 视频在线观看国产精品| 大桥未久av一区二区三区中文| 欧美亚洲国产一区二区三区va| 欧美不卡123| 亚洲免费色视频| 精久久久久久久久久久| 在线观看视频欧美| 久久久久久麻豆| 亚洲福利一二三区| 成人黄色国产精品网站大全在线免费观看 | 欧美在线制服丝袜| 久久免费看少妇高潮| 亚洲高清在线视频| 国产99精品在线观看| 91精品福利在线一区二区三区| 国产精品嫩草影院av蜜臀| 蜜臀a∨国产成人精品| 色婷婷综合久久久久中文一区二区 |