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

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

?? rps10.c

?? linux集群服務器軟件代碼包
?? C
?? 第 1 頁 / 共 2 頁
字號:
 * *      e.g. A machine named 'nodea' can kill a machine named 'nodeb' through *           a device attached to serial port /dev/ttyS0. *           A machine named 'nodeb' can kill machines 'nodea' and 'nodec' *           through a device attached to serial port /dev/ttyS1 (outlets 0  *             and 1 respectively) * *      <assuming this is the heartbeat configuration syntax:> *  *      stonith nodea rps10 /dev/ttyS0 nodeb 0  *      stonith nodeb rps10 /dev/ttyS0 nodea 0 nodec 1 * *      Another possible configuration is for 2 stonith devices *         accessible through 2 different serial ports on nodeb: * *      stonith nodeb rps10 /dev/ttyS0 nodea 0  *      stonith nodeb rps10 /dev/ttyS1 nodec 0 *//* * 	OOPS! * * 	Most of the large block of comments above is incorrect as far as this * 	module is concerned.  It is somewhat applicable to the heartbeat code, * 	but not to this Stonith module. * * 	The format of parameter string for this module is: *            <serial device> <remotenode> <outlet> [<remotenode> <outlet>] ... */static intRPS_parse_config_info(struct pluginDevice* ctx, const char * info){	char *copy;	char *token;	char *outlet, *node;	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	if (ctx->config) {		/* The module is already configured. */		return(S_OOPS);	}	/* strtok() is nice to use to parse a string with 	   (other than it isn't threadsafe), but it is destructive, so	   we're going to alloc our own private little copy for the	   duration of this function.	*/	copy = STRDUP(info);	if (!copy) {		LOG(PIL_CRIT, "out of memory");		return S_OOPS;	}	/* Grab the serial device */	token = strtok (copy, " \t");	if (!token) {		LOG(PIL_CRIT, "%s: Can't find serial device on config line '%s'",		       pluginid, info);		goto token_error;			}	ctx->device = STRDUP(token);	if (!ctx->device) {		LOG(PIL_CRIT, "out of memory");		goto token_error;	}	/* Loop through the rest of the command line which should consist of */	/* <nodename> <outlet> pairs */	while ((node = strtok (NULL, " \t"))	       && (outlet = strtok (NULL, " \t\n"))) {		char outlet_id;		/* validate the outlet token */		if ((sscanf (outlet, "%c", &outlet_id) != 1)		    || !( ((outlet_id >= '0') && (outlet_id <= '9'))			|| (outlet_id == '*') || (outlet_id == 'A') )		   ) {			LOG(PIL_CRIT			, "%s: the outlet_id %s must be between"			" 0 and 9 or '*' / 'A'",			       pluginid, outlet);			goto token_error;		}				if (outlet_id == 'A') {			/* Remap 'A' to '*'; in some configurations,			 * a '*' can't be configured because it breaks			 * scripts -- lmb */			outlet_id = '*';		}				if (ctx->unit_count >= WTI_NUM_CONTROLLERS) {			LOG(PIL_CRIT, 				"%s: Tried to configure too many controllers",				pluginid);			goto token_error;		}				ctx->controllers[ctx->unit_count].node = STRDUP(node);		g_strdown(ctx->controllers[ctx->unit_count].node);		ctx->controllers[ctx->unit_count].outlet_id = outlet_id;		ctx->unit_count++;	} 	/* free our private copy of the string we've been destructively 	 * parsing with strtok()	 */	FREE(copy);	ctx->config = 1;	return ((ctx->unit_count > 0) ? S_OK : S_BADCONFIG);token_error:	FREE(copy);	return(S_BADCONFIG);}/*  * dtrtoggle - toggle DTR on the serial port *  * snarfed from minicom, sysdep1.c, a well known POSIX trick. * */static void dtrtoggle(int fd) {	struct termios tty, old;	int sec = 2;    	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}		if (gbl_debug) {		printf ("Calling dtrtoggle (%s)\n", pluginid);    	}	tcgetattr(fd, &tty);	tcgetattr(fd, &old);	cfsetospeed(&tty, B0);	cfsetispeed(&tty, B0);	tcsetattr(fd, TCSANOW, &tty);	if (sec>0) {		sleep(sec);		tcsetattr(fd, TCSANOW, &old);	}    	if (gbl_debug) {		printf ("dtrtoggle Complete (%s)\n", pluginid);	}}/* * RPSConnect - * * Connect to the given WTI_RPS10 device.   * Side Effects *    DTR on the serial port is toggled *    ctx->fd now contains a valid file descriptor to the serial port *    ??? LOCK THE SERIAL PORT ??? *   * Returns  *    S_OK on success *    S_OOPS on error *    S_TIMEOUT if the device did not respond * */static intRPSConnect(struct pluginDevice * ctx){	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}  	  	/* Open the serial port if it isn't already open */	if (ctx->fd < 0) {		struct termios tio;		ctx->fd = open (ctx->device, O_RDWR);		if (ctx->fd <0) {			LOG(PIL_CRIT, "%s: Can't open %s : %s",				pluginid, ctx->device, strerror(errno));			return S_OOPS;		}		/* set the baudrate to 9600 8 - N - 1 */		memset (&tio, 0, sizeof(tio));		/* ??? ALAN - the -tradtitional flag on gcc causes the 		   CRTSCTS constant to generate a warning, and warnings                    are treated as errors, so I can't set this flag! - EZA ???		                      Hmmm. now that I look at the documentation, RTS		   is just wired high on this device! we don't need it.		*/		/* tio.c_cflag = B9600 | CS8 | CLOCAL | CREAD | CRTSCTS ;*/		tio.c_cflag = B9600 | CS8 | CLOCAL | CREAD ;		tio.c_lflag = ICANON;		if (tcsetattr (ctx->fd, TCSANOW, &tio) < 0) {			LOG(PIL_CRIT, "%s: Can't set attributes %s : %s",				pluginid, ctx->device, strerror(errno));			close (ctx->fd);			ctx->fd=-1;			return S_OOPS;		}		/* flush all data to and fro the serial port before we start */		if (tcflush (ctx->fd, TCIOFLUSH) < 0) {			LOG(PIL_CRIT, "%s: Can't flush %s : %s",				pluginid, ctx->device, strerror(errno));			close (ctx->fd);			ctx->fd=-1;			return S_OOPS;				}			}	/* Toggle DTR - this 'resets' the controller serial port interface            In minicom, try CTRL-A H to hangup and you can see this behavior.         */	dtrtoggle(ctx->fd);	/* Wait for the switch to respond with "RPS-10 Ready".  	   Emperically, this usually takes 5-10 seconds... 	   ... If this fails, this may be a hint that you got	   a broken serial cable, which doesn't connect hardware	   flow control.	*/	if (gbl_debug) {		printf ("Waiting for READY\n");	}	EXPECT(ctx->fd, WTItokReady, 12);	if (gbl_debug) {		printf ("Got READY\n");	}	EXPECT(ctx->fd, WTItokCRNL, 2);	if (gbl_debug) {		printf ("Got NL\n");	}  return(S_OK);}static intRPSDisconnect(struct pluginDevice * ctx){	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	if (ctx->fd >= 0) {	/* Flush the serial port, we don't care what happens to the characters	and failing to do this can cause close to hang.	*/	tcflush(ctx->fd, TCIOFLUSH);	close (ctx->fd);	}	ctx->fd = -1;	return S_OK;} /* * RPSNametoOutlet - Map a hostname to an outlet on this stonith device. * * Returns: *     0-9, * on success ( the outlet id on the RPS10 ) *     -1 on failure (host not found in the config file) *  */static signed charRPSNametoOutlet ( struct pluginDevice * ctx, const char * host ){	int i=0;	char *shost;	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	if ( (shost = STRDUP(host)) == NULL) {		LOG(PIL_CRIT, "strdup failed in RPSNametoOutlet");		return -1;	}	g_strdown(shost);			/* scan the controllers[] array to see if this host is there */	for (i=0;i<ctx->unit_count;i++) {		/* return the outlet id */		if ( ctx->controllers[i].node 		    && !strcmp(host, ctx->controllers[i].node)) {			/* found it! */			break;		}	}		free(shost);	if (i == ctx->unit_count) {		return -1;	} else {		return ctx->controllers[i].outlet_id;	}}/* *	rps10_reset - API call to Reset (reboot) the given host on  *          this Stonith device.  This involves toggling the power off  *          and then on again, OR just calling the builtin reset command *          on the stonith device. */static intrps10_reset_req(StonithPlugin * s, int request, const char * host){	int	rc = S_OK;	int	lorc = S_OK;	signed char outlet_id = -1;	struct pluginDevice*	ctx;		if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	if (gbl_debug) {		printf ("Calling rps10_reset (%s)\n", pluginid);	}	ERRIFNOTCONFIGED(s,S_OOPS);	ctx = (struct pluginDevice*) s;	if ((rc = RPSConnect(ctx)) != S_OK) {		return(rc);	}	outlet_id = RPSNametoOutlet(ctx, host);	if (outlet_id < 0) {		LOG(PIL_WARN, "%s %s %s[%s]"		,	ctx->idinfo, ctx->unitid		,	_("doesn't control host"), host );		RPSDisconnect(ctx);		return(S_BADHOST);	}	switch(request) {#if defined(ST_POWERON) 		case ST_POWERON:			rc = RPSOn(ctx, outlet_id, host);			break;#endif#if defined(ST_POWEROFF)		case ST_POWEROFF:			rc = RPSOff(ctx, outlet_id, host);			break;#endif	case ST_GENERIC_RESET:		rc = RPSReset(ctx, outlet_id, host);		break;	default:		rc = S_INVAL;		break;	}	lorc = RPSDisconnect(ctx);	return(rc != S_OK ? rc : lorc);}/* *	Parse the information in the given string, *	and stash it away... */static intrps10_set_config(StonithPlugin* s, StonithNVpair* list){	char	RPSid[MAX_PRSID];	struct pluginDevice*	ctx;	StonithNamesToGet	namestoget [] =	{	{ST_RPS10,	NULL}	,	{NULL,		NULL}	};	int rc=0;	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	ERRIFWRONGDEV(s,S_OOPS);	ctx = (struct pluginDevice*) s;	if((rc = OurImports->GetAllValues(namestoget , list)) != S_OK){		LOG(PIL_DEBUG , "get all calues failed");			return rc;	}		if ((snprintf(RPSid, MAX_PRSID, "%s", 		namestoget[0].s_value)) <= 0) {		LOG(PIL_CRIT, "Can not copy parameter to PRSid");	}		return (RPS_parse_config_info(ctx,RPSid));	}/* *  Return the Stonith plugin configuration parameter  * */static const char**rps10_get_confignames(StonithPlugin* p){	static const char *	Rps10Params[] = {ST_RPS10 ,NULL };	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	return Rps10Params;}/* * rps10_getinfo - API entry point to retrieve something from the handle */static const char *rps10_getinfo(StonithPlugin * s, int reqtype){	struct pluginDevice* ctx;	const char *	ret;	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	ERRIFWRONGDEV(s,NULL);	/*	 *	We look in the ST_TEXTDOMAIN catalog for our messages	 */	ctx = (struct pluginDevice *)s;	switch (reqtype) {		case ST_DEVICEID:			ret = ctx->idinfo;			break;		case ST_DEVICEDESCR:			ret = _("Western Telematic Inc. (WTI) "			"Remote Power Switch - RPS-10M.\n");			break;		default:			ret = NULL;			break;	}	return ret;}/* * rps10_destroy - API entry point to destroy a WTI_RPS10 Stonith object. */static voidrps10_destroy(StonithPlugin *s){	struct pluginDevice* ctx;	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	VOIDERRIFWRONGDEV(s);	ctx = (struct pluginDevice *)s;	ctx->pluginid = NOTwtiid;	/*  close the fd if open and set ctx->fd to invalid */	RPSDisconnect(ctx);		if (ctx->device != NULL) {		FREE(ctx->device);		ctx->device = NULL;	}	if (ctx->idinfo != NULL) {		FREE(ctx->idinfo);		ctx->idinfo = NULL;	}	if (ctx->unitid != NULL) {		FREE(ctx->unitid);		ctx->unitid = NULL;	}}/*  * rps10_new - API entry point called to create a new WTI_RPS10 Stonith device *          object.  */static StonithPlugin * rps10_new(void){	struct pluginDevice*	ctx = MALLOCT(struct pluginDevice);	if (Debug) {		LOG(PIL_DEBUG, "%s:called.", __FUNCTION__);	}	if (ctx == NULL) {		LOG(PIL_CRIT, "out of memory");		return(NULL);	}	memset(ctx, 0, sizeof(*ctx));	ctx->pluginid = pluginid;	ctx->fd = -1;	ctx->config = 0;	ctx->unit_count = 0;	ctx->device = NULL;	ctx->idinfo = NULL;	ctx->unitid = NULL;	REPLSTR(ctx->idinfo, DEVICE);	REPLSTR(ctx->unitid, "unknown");	ctx->sp.s_ops = &rps10Ops;	return &(ctx->sp);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩久久久| 久久综合色一综合色88| 日韩一区二区三区电影在线观看| 欧美变态凌虐bdsm| 亚洲欧洲成人自拍| 免费美女久久99| 色系网站成人免费| 国产亚洲一区二区三区在线观看 | 日韩精品一区二| 一区二区三区中文在线| 懂色av中文字幕一区二区三区 | 午夜电影一区二区| 99天天综合性| 久久久三级国产网站| 视频在线在亚洲| 欧美日韩一区二区三区高清| 国产精品私房写真福利视频| 精品一区二区三区久久久| 欧美亚洲愉拍一区二区| 亚洲色图视频免费播放| 风间由美一区二区av101| 日韩午夜中文字幕| 天堂久久一区二区三区| 在线观看www91| 椎名由奈av一区二区三区| 国产精品亚洲一区二区三区妖精 | 久久激五月天综合精品| 欧美精三区欧美精三区| 亚洲成人1区2区| 欧美午夜电影一区| 亚洲国产精品一区二区久久 | 成人性视频免费网站| 久久午夜色播影院免费高清 | 午夜伦欧美伦电影理论片| 色婷婷综合五月| 亚洲三级视频在线观看| 色综合天天综合网天天看片| 亚洲欧美在线aaa| 91蜜桃免费观看视频| 亚洲欧美国产高清| 在线亚洲欧美专区二区| 亚洲福利电影网| 欧美一级二级在线观看| 久久成人免费网| 国产丝袜美腿一区二区三区| 成人性色生活片| 亚洲视频在线一区| 欧美日韩国产一级片| 久久国产精品99精品国产| 亚洲精品一区二区精华| 成人sese在线| 一区二区三区不卡视频在线观看| 欧美日韩成人一区二区| 免费在线观看视频一区| 国产婷婷一区二区| 欧美伊人久久久久久久久影院 | 一区二区三区美女| 欧美精品在线观看播放| 精彩视频一区二区三区| 国产精品另类一区| 欧美性xxxxx极品少妇| 蜜臀久久久久久久| 中文av一区特黄| 欧美日韩视频不卡| 国产麻豆日韩欧美久久| 一区二区三区高清不卡| 精品av久久707| 成人高清视频在线| 日韩精品亚洲一区二区三区免费| 久久精品一区二区三区不卡牛牛| 色综合久久中文字幕| 免费在线看成人av| 亚洲精品中文字幕在线观看| 日韩亚洲欧美高清| 91亚洲午夜精品久久久久久| 美女精品自拍一二三四| 亚洲精品视频一区二区| 欧美不卡激情三级在线观看| 91网站在线观看视频| 激情综合色播五月| 亚洲第一久久影院| 欧美国产禁国产网站cc| 8x8x8国产精品| 91麻豆精品视频| 国产精品99久久久| 日韩不卡免费视频| 一区二区三区蜜桃网| 中文字幕乱码一区二区免费| 欧美浪妇xxxx高跟鞋交| 91免费视频网址| 国产电影一区二区三区| 毛片不卡一区二区| 亚洲国产综合色| 1区2区3区欧美| 国产亚洲1区2区3区| 日韩视频免费观看高清在线视频| 91蜜桃免费观看视频| www.激情成人| 国产999精品久久久久久| 秋霞电影网一区二区| 亚洲高清免费观看 | 中文字幕精品在线不卡| 日韩欧美美女一区二区三区| 欧美日韩一级大片网址| 色噜噜夜夜夜综合网| 99re免费视频精品全部| 成人av资源网站| 成人激情免费电影网址| 国产毛片精品国产一区二区三区| 九九精品视频在线看| 久久成人免费电影| 国产一区二区三区四区五区入口 | 国产日韩欧美精品一区| 精品久久久久久久久久久久久久久 | 日韩精品一区二区三区中文精品| 欧美亚洲综合在线| 欧美日韩一区二区在线观看视频| 欧美优质美女网站| 欧美性生活影院| 欧美伦理影视网| 欧美一区二区私人影院日本| 91精品国产综合久久蜜臀| 3atv一区二区三区| 欧美大片国产精品| 久久久精品黄色| 国产精品网曝门| 亚洲免费av高清| 亚州成人在线电影| 日韩av电影天堂| 精品亚洲成a人在线观看| 福利电影一区二区| 色天使色偷偷av一区二区| 欧美性大战久久久久久久| 欧美一区二区人人喊爽| 久久亚洲欧美国产精品乐播| 中文字幕免费观看一区| 亚洲激情第一区| 日韩中文字幕1| 国产一区二区三区免费看 | 欧美一区二区在线播放| 久久日一线二线三线suv| 国产欧美日韩在线视频| 一区二区三区色| 精品无码三级在线观看视频| 成人激情黄色小说| 51精品视频一区二区三区| 久久欧美中文字幕| 亚洲免费色视频| 精东粉嫩av免费一区二区三区| 不卡的电影网站| 3d动漫精品啪啪一区二区竹菊 | 日韩精品一区二区三区视频播放 | 久久欧美中文字幕| 亚洲精品国产成人久久av盗摄| 亚洲成人精品影院| 国产成人免费9x9x人网站视频| 99riav久久精品riav| 精品国产91洋老外米糕| 一区二区三区免费观看| 国产精品99久久久久久有的能看| 欧美在线观看视频一区二区三区 | 5月丁香婷婷综合| 日韩一区在线看| 国产在线视频一区二区| 一道本成人在线| 国产婷婷精品av在线| 日本特黄久久久高潮| 91亚洲精品久久久蜜桃网站 | 日韩欧美电影一区| 亚洲伦理在线免费看| 久久aⅴ国产欧美74aaa| 欧美色视频在线| 国产精品美女久久久久久久久久久| 视频一区免费在线观看| 91麻豆免费看片| 久久精品一区二区三区不卡牛牛| 青青草伊人久久| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产午夜亚洲精品午夜鲁丝片| 日本午夜一区二区| 欧美午夜影院一区| 一区二区三区在线视频播放| 懂色中文一区二区在线播放| 日韩精品一区二区三区在线 | 天天色 色综合| 色一情一乱一乱一91av| 一区二区中文字幕在线| 国产一区二区久久| 欧美xxxx老人做受| 免费在线观看成人| 在线播放日韩导航| 亚洲一卡二卡三卡四卡无卡久久| av中文字幕在线不卡| 亚洲国产激情av| 国产在线精品一区二区不卡了| 欧美一区二区三区四区高清| 午夜精品久久久久久久久| 欧美日韩精品欧美日韩精品一综合| 亚洲激情第一区| 欧美日韩国产综合一区二区|